QUESTION 121
You want to execute a SQL insert statement from your client application, so you set the CommandText property of the command object and open the connection. Which method will you execute on the command?
A. ExecuteScalar
B. ExecuteXmlReader
C. ExecuteReader
D. ExecuteNonQuery
Answer: D
QUESTION 122
In ADO.NET, which class can start an explicit transaction to update a SQL Server database?
A. SqlCommand
B. SqlConnection
C. SqlParameter
D. SqlException
Answer: B
QUESTION 123
You want to store the contents of a data set to an XML file so you can work on the data while disconnected from the database server. How should you store this data?
A. As a SOAP file
B. As a DataGram file
C. As a WSDL file
D. As an XML Schema file
Answer: B
QUESTION 124
To which of the following types can you add an extension method? (Each correct answer presents a complete solution. Choose five.)
A. Class
B. Structure (C# struct)
C. Module (C# static class)
D. Enum
E. Interface
F. Delegate
Answer: ABDEF
QUESTION 125
You want to page through an element sequence, displaying ten elements at a time, until you reach the end of the sequence. Which query extension method can you use to accomplish this? (Each correct answer presents part of a complete solution. Choose two.)
A. Skip
B. Except
C. SelectMany
D. Take
Answer: AD
QUESTION 126
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You use the ADO.NET Entity Data Model (EDM) to define a Customer entity.
You need to add a new Customer to the data store without setting all the customer’s properties. What should you do?
A. Call the Create method of the Customer object.
B. Call the CreateObject method of the Customer object.
C. Override the Create method for the Customer object.
D. Override the SaveChanges method for the Customer object.
Answer: B
QUESTION 127
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database.
You use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities.
You need to ensure that the change-tracking information for the self-tracking entities can be used to update the database.
Which ObjectContext method should you call after changes are made to the entities?
A. Attach
B. Refresh
C. SaveChanges
D. ApplyChanges
Answer: D
QUESTION 128
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application uses the ADO.NET Entity Framework to manage Plain Old CLR Objects (POCO) entities.
You create a new POCO class. You need to ensure that the class meets the following requirements:
It can be used by an ObjectContext.
It is enabled for change-tracking proxies.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Modify each mapped property to contain sealed and protected accessors.
B. Modify each mapped property to contain non-sealed, public, and virtual accessors.
C. Configure the navigation property to return a type that implements the ICollection interface.
D. Configure the navigation property to return a type that implements the IQueryable interface.
E. Configure the navigation property to return a type that implements the IEntityWithRelationships interface.
Answer: BC
QUESTION 129
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application uses the ADO.NET Entity Framework to model entities.
The application allows users to make changes while disconnected from the data store.
Changes are submitted to the data store by using the SubmitChanges method of the DataContext object.
You receive an exception when you call the SubmitChanges method to submit entities that a user has changed in offline mode.
You need to ensure that entities changed in offline mode can be successfully updated in the data store.
What should you do?
A. Set the ObjectTrackingEnabled property of DataContext to true.
B. Set the DeferredLoadingEnabled property of DataContext to true.
C. Call the SaveChanges method of DataContext with a value of false.
D. Call the SubmitChanges method of DataContext with a value of System.Data.Linq.ConflictMode.
ContinueOnConflict.
Answer: A
QUESTION 130
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database.
The application uses the ADO.NET LINQ to SQL model to retrieve data from the database.
The application will not modify retrieved data. You need to ensure that all the requested data is retrieved.
You want to achieve this goal using the minimum amount of resources. What should you do?
A. Set ObjectTrackingEnabled to true on the DataContext class.
B. Set ObjectTrackingEnabled to false on the DataContext class.
C. Set DeferredLoadingEnabled to true on the DataContext class.
D. Set DeferredLoadingEnabled to false on the DataContext class.
Answer: B
All Free Pass4sure PDF & VCE 70-516 Exam Questions