Ensurepass

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?

 

  1. ExecuteScalar

  2. ExecuteXmlReader

  3. ExecuteReader

  4. ExecuteNonQuery

 

Correct Answer: D

 

 

QUESTION 122

In ADO.NET, which class can start an explicit transaction to update a SQL Server database?

 

  1. SqlCommand

  2. SqlConnection

  3. SqlParameter

  4. SqlException

 

Correct 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?

 

  1. As a SOAP file

  2. As a DataGram file

  3. As a WSDL file

  4. As an XML Schema file

 

Correct 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.)

 

  1. Class

  2. Structure (C# struct)

  3. Module (C# static class)

  4. Enum

  5. Interface

  6. Delegate

 

Correct 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.)

 

  1. Skip

  2. Except

  3. SelectMany

  4. Take

 

Correct 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?

 

  1. Call the Create method of the Customer object.

  2. Call the CreateObject method of the Customer object.

  3. Override the Create method for the Customer object.

  4. Override the SaveChanges method for the Customer object.

 

Correct 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?

 

  1. Attach

  2. Refresh

  3. SaveChanges

  4. ApplyChanges

 

Correct 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.)

 

  1. Modify each mapped property to contain sealed and protected accessors.

  2. Modify each mapped property to contain non-sealed, public, and virtual accessors.

  3. Configure the navigation property to return a type that implements the ICollection interface.

  4. Configure the navigation property to return a type that implements the IQueryable interface.

  5. Configure the navigation property to return a type that implements the IEntityWithRelationships interface.

 

Correct 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?

 

  1. Set the ObjectTrackingEnabled property of DataContext to true.

  2. Set the DeferredLoadingEnabled property of DataContext to true.

  3. Call the SaveChanges method of DataContext with a value of false.

  4. Call the SubmitChanges method of DataContext with a value of System.Data.Linq.ConflictMode.< /font>

ContinueOnConflict.

 

Correct 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?

 

  1. Set ObjectTrackingEnabled to true on the DataContext class.

  2. Set ObjectTrackingEnabled to false on the DataContext class.

  3. Set DeferredLoadingEnabled to true on the DataContext class.

  4. Set DeferredLoadingEnabled to false on the DataContext class.

 

Correct Answer: B

 

Instant Access to Download Latest Complete Collection of Microsoft MCTS 70-516 Real Exam

Try Microsoft MCTS 70-516 Free Demo

Comments are closed.