Issuu on Google+

Exam 70-561 study material Made available by Aonetesting.com

Free 70-561 Exam Preparation Questions Exam 70-561: TS: Microsoft .NET Framework 3.5, ADO.NET Application Development

For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


Question:1 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, ordistributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. The application reads data from a Microsoft SQL Server 2005 database. A strongly tpyed DataSet named Commodities is used by the application. The Commodities DataSet contains the following objects: Two DataTables named Commodity and Seller A DataRelation named SellerCommodity which relates the Commodity DataTable to the Seller DataTable. There's a stored procedure named GetSellerCommodities. Two resultsets are returned by this procedure. The two resultsets respectively contain two lists: a list of Sellers; a list of Commodities by each Seller. You write the following code segment. (Line numbers are included for reference only.) 1 Dim dsCommodities As New Commodities ()2 Using da As New SqlDataAdapter() 3 da.SelectCommand = New SqlCommand("execGetSeller Commodities")4 5 da.Fill(ds Commodities) 6 End Using You must make sure that that the resultsets from the stored procedure are correctly loaded intothe DataTables. At line4, which code segment should you insert? A. da.TableMappings.Add("Table1", "Seller")da.TableMappings.Add("Table2", "Commodity") B. da.TableMappings.Add("Table", "Seller")da.TableMappings.Add("Table1", "Commodity") C. da.TableMappings.Add("Table", "SellerCommodity")da.TableMappings.Add("Table1" "SellerCommodity") D. da.TableMappings.Add("Table", "Seller")da.TableMappings.Add("Table1", "SellerCommodity") Answer: B Question:2 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, or distributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. The application reads data from a Microsoft SQL Server 2005 database. You write the following DDL statement. CREATE TABLE [dbo].[tblTest]( [C1] [int] IDENTITY(1,1) NOT NULL, [C2] [char](4) NULL, [C3] NUMERIC(1,1) NOT NULL, [C4] AS (C1*C3) ) ON [PRIMARY] The application contains a method named renew. The following code segment is used by therenew method. Dim da As New SqlDataAdapter("SELECT * FROM tblTest", sc) da.RenewCommand = _ New SqlCommand("RENEW tblTest SET C2 = @C2," + _ " C3 = @C3, C4 = @C4 WHERE C1 = @C1", sc) da.RenewCommand.Parameters.Add("@C1", SqlDbType.Int, 4, "C1") Dim prm1 As New SqlParameter("@C2", SqlDbType.[Char], 4) prm1.SourceColumn = "C2" da.RenewCommand.Parameters.Add(prm1) Dim prm2 As New SqlParameter("@C3", SqlDbType.[Decimal], 4) prm2.SourceColumn = "C3" da.RenewCommand.Parameters.Add(prm2) Dim prm3 As New SqlParameter("@C4", SqlDbType.[Char], 4) prm3.SourceColumn = "C4" da.RenewCommand.Parameters.Add(prm3) A SqlException exception is thrown when you execute the method. You must make sure that the method is successfully executed. What should you do? A. You should alter the SqlDbType parameter to Decimal in column C4. B. You should alter the SqlDbType parameter to Money in column C4. C. You should get rid of column C3 and its associated parameters from the RENEW statement. D. You should get rid of column C4 and its associated parameters from the RENEW statement. Answer: D Question:3 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, ordistributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application which uses ADO.NET Entity Framework for persistence. The following storage schema definition is generated for an entity named Supplier. <EntityType Name="Supplier"> <Key> <PropertyRef Name="ID" /></Key><Property Name="ID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> <Property Name="Country" Type="char" MaxLength="3" /> <Property Name="City" Type="nvarchar" MaxLength="20" /> </EntityType> You have to map the City column and the Country column as a separate type named Address in the conceptual schema. What should you do? (Choose more than one.) A. Create the following conceptual schema definition. <EntityType Name="Address"> <Key><PropertyRef Name="ID"/></Key> <Property Name="ID" Type="Int32" Nullable="false" /> <Property Name="Country" Type="String" For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


MaxLength="3" /> <Property Name="City" Type="String" MaxLength="20" /></EntityType><EntityType Name="Supplier"> <Key><PropertyRef Name="ID" /></Key> <Property Name="ID" Type="Int32" Nullable="false" /> <Property Name="Address" Type="ContosoModel.Address" Nullable="false" /></EntityType> B. Create the following mapping schema definition. <EntityTypeMapping TypeName="IsTypeOf(ContosoModel.Supplier)"> <MappingFragment StoreEntitySet="Supplier"> <ScalarProperty Name="ID" ColumnName="ID" /> <ScalarProperty Name="Address.Country" ColumnName="Country" /> <ScalarProperty Name="Address.City" ColumnName="City" /> </MappingFragment></EntityTypeMapping> C. Create the following mapping schema definition. <EntityTypeMapping TypeName="IsTypeOf(ContosoModel.Supplier)"> <MappingFragment StoreEntitySet="Supplier"> <ScalarProperty Name="ID" ColumnName="ID" /> <ComplexProperty Name="Address" TypeName="ContosoModel.Address"> <ScalarProperty Name="Country" ColumnName="Country" /> <ScalarProperty Name="City" ColumnName="City" /> </ComplexProperty> </MappingFragment></EntityTypeMapping> D. Create the following mapping schema definition. <EntitySetMapping Name="Supplier" <EntityTypeMapping TypeName="IsTypeOf(ContosoModel.Supplier)"> <MappingFragment StoreEntitySet="Supplier"> <ScalarProperty Name="ID" ColumnName="ID" /> </MappingFragment> <MappingFragment StoreEntitySet="Address"> <ScalarProperty Name="Country" ColumnName="Country" /> <ScalarProperty Name="City" ColumnName="City" /> </MappingFragment></EntityTypeMapping> E. Create the following conceptual schema definition. <ComplexType Name="Address"> <Property Name="Country" Type="String" MaxLength="3" /> <Property Name="City" Type="String" MaxLength="20" /></ComplexType><EntityType Name="Supplier"> <Key><PropertyRef Name="ID" /></Key> <Property Name="ID" Type="Int32" Nullable="false" /> <Property Name="Address" Type="ContosoModel.Address" Nullable="false" /></EntityType> Answer: C, E Question:4 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, ordistributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 to create an application. You access data for the application by using Microsoft ADO.NET. The application reads data from a Microsoft SQL Server 2005 database. There's a table named Users in the database. In a secondary Microsoft Office Access database, there's also a table named Users. The first table has the same schema as the second table. You often upgrade the data in the Access database. You write the following code segment. (Line numbers are used for reference only.) 1 Dim con As New SqlConnection() 2 'Setup con 3 Dim sql As String = "Select * from User" 4 Dim adp As New SqlDataAdapter(sql, con)5 Dim bld As New SqlCommandBuilder(adp) 6 Dim tblCust As New DataTable() 7 adp.FillSchema(tblCust, SchemaType.Source) 8 adp.Fill(tblCust)08 Dim conAc As New OleDbConnection() 9 Dim cmd As New OleDbCommand(sql, conAc) 10 'Setup conAc 11 conAc.Open() 12 Dim rd As IDataReader = cmd.ExecuteReader() 13 14 conAc.Close() 15 adp.Update(tblCust) According to the requirement of the company CIO, the data from the User table of the Access database must be merged to that of the SQL Server 2005 database. You are assigned to achieve this goal. So at line 13, which code segment should you insert? A. tblUser.Merge(rd.GetSchemaTable()) B. tblUser.Load(rd, LoadOption.Upsert) C. tblUser.Load(rd, LoadOption.PreserveChanges) D. tblUser.Load(rd, LoadOption.OverwriteChanges) Answer: B Question:5 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, ordistributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. You write the following code segment in the application. (Line numbers are used for reference only.) 01 Dim connString As String = _ "server=localhost;database=Store;uid=user;pwd=pass;" 02 Dim conn As New SqlConnection(connString)03 Dim sqlDep As New SqlDependency() 04 AddHandler sqlDep.OnChange, AddressOf sqlDep_OnChange05 06 cmd.ExecuteNonQuery() 07 cmd.Connection.Close() You store order details in a table named Orders in the Store database. You must make sure that if an order is inserted or updated in the Orders table, the application receives a notification. At line 05, which code segment should you insert? A. Dim cmd As New _ SqlCommand("SELECT OrderID, Amount, Notes FROM Orders", _ conn)sqlDep.AddCommandDependency(cmd)SqlDependency.Start(connString) B. Dim cmd As New _ SqlCommand("SELECT OrderID, Amount, Notes FROM dbo.Orders", _ For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


conn)sqlDep.AddCommandDependency(cmd)cmd.Connection.Open()SqlDependency.Start(c onnString) C. Dim cmd As New _ SqlCommand("SELECT OrderID, Amount, Notes FROM dbo.Orders", _ conn)sqlDep.AddCommandDependency(cmd)SqlDependency.Start(connString) D. Dim cmd As New _ SqlCommand("SELECT OrderID, Amount, Notes FROM Orders", _ conn)sqlDep.AddCommandDependency(cmd)SqlDependency.Start(connString)cmd.Connecti on.Open() Answer: B Question:6 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, or distributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. The application reads data from a Microsoft SQL Server 2005 database. The application uses the following stored procedure. CREATE PROCEDURE [dbo].[UpdateShippers] @CountryCode NVarchar(10) ,@NewRateCode int AS BEGIN Update dbo.Shippers SET RateCode = @NewRateCode Where CountryCode = @CountryCode RETURN @@ROWCOUNTEND You write the following code segment. (Line numbers are included for reference only.) 1 Using connection As New SqlConnection(connectionString)2 connection.Open() 3 Dim command As New SqlCommand("UpdateShippers", connection) 4 5 command.ExecuteNonQuery() 6 End Using You must make sure that the application can update the Shippers table. At line 4, which codesegment should you insert? A. command.CommandType = CommandType.StoredProcedureDim parameter As SqlParameter = _ command.Parameters.Add("@RowCount", SqlDbType.Int)parameter.Direction = ParameterDirection.Outputparameter = command.Parameters.Add("@CountryCode", _ SqlDbType.NVarChar, 10, "CountryCode")parameter = command.Parameters.Add("@NewRateCode", _ SqlDbType.Int, 0, "RateCode")command.Parameters("@CountryCode").Value = USA"command.Parameters("@NewRateCode").Value = "778" B. command.CommandType = CommandType.StoredProcedureDim parameter As SqlParameter = _ command.Parameters.Add("@RowCount", SqlDbType.Int)parameter.Direction = ParameterDirection.ReturnValueparameter = command.Parameters.Add("CountryCode", _ SqlDbType.NVarChar, 10, "@CountryCode")parameter = command.Parameters.Add("RateCode", _ SqlDbType.Int, 0, "@NewRateCode")command.Parameters("CountryCode").Value = "USA"command.Parameters("RateCode").Value = "778" C. command.CommandType = CommandType.StoredProcedureDim parameter As SqlParameter = _ command.Parameters.Add("@RowCount", SqlDbType.Int)parameter.Direction = ParameterDirection.InputOutputparameter = command.Parameters.Add("@CountryCode" SqlDbType.NVarChar, 10)parameter = command.Parameters.Add("@NewRateCode", _ SqlDbType.Int, 0)command.Parameters("@CountryCode").Value = "USA"command.Parameters("@NewRateCode").Value = "778" D. command.CommandType = CommandType.StoredProcedureDim parameter As SqlParameter = _ command.Parameters.Add("@RowCount", SqlDbType.Int)parameter.Direction = ParameterDirection.ReturnValueparameter = command.Parameters.Add("@CountryCode", _ SqlDbType.NVarChar, 10)parameter = command.Parameters.Add("@NewRateCode", _ SqlDbType.Int)command.Parameters("@CountryCode").Value = "USA"command.Parameters("@NewRateCode").Value = "778" Answer: D Question:7 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, or distributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. There's a database that contains a DataTable object named DataTable 01. Customer records are loaded into DataTable 01 by using the application. Users of the application will update these customer records in DataTable 01. Now you find that the data in the updated records may includes errors. Before the data is saved to the database, the data in the updated records is validated. So what should you do? A. Before you save the updated records to the database, call the RejectChanges method of the DataTable object. Call the GetChanges method of the DataTable object to create a copy of the DataTable object that contains the changes. Add a validation code to validate the DataTable object that contains the changes. B. For the TableNewRow event of the DataTable object, create an event handler. In the event handler, add a validation code to validate the row that is supplied by the DataTableNewRowEventArgs object. For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


C. For the RowChanging event of the DataTable object, Create an event handler. In the event handler, add a validation code to validate the row that is supplied by the DataRowChangeEventArgs object. D. Before you save the updated records to the database, call the AcceptChanges method of the DataTable object. Call the GetChanges method of the DataTable object to create a copy of the DataTable object that contains the changes. Answer: C Question:8 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, or distributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. There's a Microsoft SQL Server 2005 database in the company network. The application reads data from the Microsoft SQL Server 2005 database. The application contains a DataTable named CustomerAccts. The table below shows the structure of the DataTable. You write the following code segment. (Line numbers are used for reference only.) 01 Dim AccountSuspendedColumn As New DataColumn() 02 AccountSuspendedColumn.DataType = GetType(Boolean) 03 AccountSuspendedColumn.ColumnName = "AccountSuspended" 05 CustomerAccts.Columns.Add(AccountSuspendedColumn) When the value contained in the LatePaymentsCount column is greater than 10 and the value contained in the OverrideCode column is equal to "EXEMPT", you must make sure that the values in the AccountSuspendedColumn column are set to True. At line 4, which code segment should you insert?

A. AccountSuspendedColumn.Expression = _ "(@LatePaymentsCount > 10) AND @OverrideCode = #EXEMPT# " B. AccountSuspendedColumn.Expression = _ "('LatePaymentsCount' > 10) AND 'OverrideCode' = 'EXEMPT' " C. AccountSuspendedColumn.Expression = _ "('@LatePaymentsCount' > 10) AND 'OverrideCode' = 'EXEMPT' " D. AccountSuspendedColumn.Expression = _ "(LatePaymentsCount > 10) AND OverrideCode = 'EXEMPT' " Answer: D Question:9 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, or distributed applications by using the Microsoft .NET Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft ADO.NET to create an application. There's a database named Sellings in a Microsoft SQL Server 2005 server named Server1. The application is used to retrieve records from the Sellings database. An instance of the SqlConnection class has the following connection string. "Data Source=ProdServer;UID=SalesUser;PWD=Pa$$w0rd;" The application uses the instance to connect to the database. The following exception is thrown when the application calls the Open method of the SqlConnection object. "Cannot open user default database. Login failed. Login failed for user 'SalesUser'". Sellings is the default database for SellingsUser You must make sure that when the user account for the connection is SellingssUser, you can connect to the Selling database successfully. What should you do? A. You should modify the connection string in the following manner. "Server=ProdServer;Database=Sales;UID=SalesUser;PWD=Pa$$w0rd;" B. You should modify the connection string in the following manner. "Data Source=ProdServer;Initial Catalog=Sales;UID=SalesUser; PWD=Pa$$w0rd;" C. A login should be created for SalesUser on ProdServer. D. You should create a database user object in the Sales database. Map the object to the SQL Server 2005 login of SalesUser. Answer: D Question:10 You have just graduated from college, now you are serving the internship as the software developer in an international company. You have some experience developing Web, Windows, or distributed applications by using the Microsoft .NET For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


Framework. Now according to the company requirement, you use the Microsoft .NET Framework 3.5 and Microsoft Synchronization Services for Microsoft ADO.NET to create an application. There's a database that contains two tables named Bills and BillDetails. The application uses this database. Between these two tables, a primary key to foreign key relationship exists. You write the following code segment. Dim tableBills As New SyncTable("Bills") Dim tableBillsDetails As New SyncTable("BillsDetails") Dim billGroup As New SyncGroup("Changes") You must make sure that updates are synchronized to both the tables and referential integrity is accounted for. Which two code segments should you add? (choose more than one) A. tableBillsDetails.TableName = _ billGroup.GroupName B. tableBills.SyncGroup = billGroup C. tableBills.TableName = billGroup.GroupName D. tableBillsDetails.SyncGroup = billGroup Answer: B, D

For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


For complete Exam 70-561 Training kits and Self-Paced Study Material Visit: http://www.aonetesting.com/70-561.html

http://www.aonetesting.com

For Latest 70-561 Exam Questions and study guides- visit- http://www.aonetesting.com/70-561.html


Exam 70-561 Preparation Questions