Ensurepass

QUESTION 11

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application contains the following XML fragment:

 

<ApplicationMenu>

<MenuItem name=”File”>

<MenuItem name=”New”>

<MenuItem name=”Project” />

<MenuItem name=”Web Site” />

</MenuItem>

<MenuItem name=”Open”>

<MenuItem name=”Project” />

<MenuItem name=”Web Site” />

</MenuItem>

<MenuItem name=”Save” />

</MenuItem>

<MenuItem name=”Edit”>

<MenuItem name=”Cut” />

<MenuItem name=”Copy” />

<MenuItem name=”Paste” />

</MenuItem>

<MenuItem name=”Help”>

<MenuItem name=”Help” />

<MenuItem name=”About” />

</MenuItem>

</ApplicationMenu>

The application queries the XML fragment by using the XmlDocument class. You need to select all the descendant elements of the MenuItem element that has its name attribute as File. Which XPath expression should you use?

 

  1. //*[@name=’File’][name()=’MenuItem’]

  2. /ApplicationMenu/MenuItem[‘File’]//MenuItem

  3. /ApplicationMenu/MenuItem/descendant::MenuItem[‘File’]

  4. /ApplicationMenu/MenuItem[@name=’File’]/descendant::MenuItem

 

Correct Answer: D

 

 

QUESTION 12

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. You deploy the service to the following URL:

 

http://contoso.com/Northwind.svc.

You want to query the WCF Data Services service to retrieve a list of customer objects. You need to ensure that the query meets the following requirements:

 

  • Only customers that match the following filter criteria are retrieved: City=”Seattle” AND Level > 200.

  • Data is sorted in ascending order by the ContactName and Address properties.

 

Which URL should you use for the query?

  1. http://contoso.com/Northwind.svc/Customers?City=Seattle & Level gt 200 & $orderby=ContactName, Address

  2. http://contoso.com/Northwind.svc/Customers?City=Seattle & Level gt 200 & $orderby=ContactName and Address

  3. http://contoso.com/Northwind.svc/Customers?$filter=City eq ‘Seattle’ and Level gt 200 &

$orderby=ContactName, Address

  1. http://contoso.com/Northwind.svc/Customers?$filter=City eq ‘Seattle’ and Level gt 200 &

$orderby=ContactName and Address

 

Correct Answer: C

 

 

QUESTION 13

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. You deploy the data service to the following URL:

 

http://contoso.com/Northwind.svc.

 

You need to update the City property of the Customer record that has its ID value as 123. You also need to preserve the current values of the remaining properties. Which HTTP request should you use?

 

  1. PUT /Northwind.svc/Customers(123)

Host: contoso.com

Content-Type: application/json { City: ‘Seattle’ }

 

  1. PUT /Northwind.svc/Customers(123)

Host: contoso.com

Accept: application/json { City: ‘Seattle’ }

 

  1. MERGE /Northwind.svc/Customers(123)

Host: contoso.com

Content-Type: application/json { City: ‘Seattle’ }

 

  1. MERGE /Northwind.svc/Customers(123)

Host: contoso.com

Accept: application/json { City: ‘Seattle’ }

 

Correct Answer: C

 

 

QUESTION 14

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. The application uses DataContexts to query the database. You create a function that meets the following requirements:

  • Updates the Customer table on the database when a customer is marked as deleted.

  • Updates the related entries in other tables (CustomerAddress, CustomerContacts) by marking them as deleted.

  • Prevents consumer code from setting the Deleted column’s value directly.

 

You need to ensure that the function verifies that customers have no outstanding orders before they are marked as deleted. You also need to ensure that existing applications can use the update function without requiring changes in the code. What should you do?

 

  1. Override the Delete operation of the DataContext object.

  2. Override the Update operation of the DataContext object.

  3. Modify the SELECT SQL statement provided to the DataContext object to use an INNER JOIN between the Customer and Orders tables.

  4. Add new entities to the DataContext object for the Customers and Orders tables.

 

Correct Answer: A

 

 

QUESTION 15

You use Microsoft Visual Studio 2010 and the Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses DataContexts to query the database. You define a foreign key between the Customers and Orders tables in the database. You need to ensure that when you delete a customer record, the corresponding order records are deleted. You want to achieve this goal by using the minimum amount of development effort. What should you do?

 

  1. Override the Delete operation of the customer entity.

  2. Remove the foreign key between the Customers and Orders tables.

  3. Use the ExecuteDynamicDelete method of the DataContext object.

  4. Modify the foreign key between the Customers and Orders tables to enable the ON DELETE CASCADE option.

 

Correct Answer: D

 

 

QUESTION 16

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 DataContexts to query the database. The application meets the following requirements:

 

  • Stores customer data offline.

  • Allows users to update customer records while they are disconnected from the server.

  • Enables offline changes to be submitted back to the SQL Server by using the DataContext object.

 

You need to ensure that the application can detect all conflicts that occur between the offline customer information submitted to the SQL Server and the server version. You also need to ensure that you can roll back local changes. What should you do?

 

  1. Add a try/catch statement around calls to the SubmitChanges method of the DataContext object and catch SqlExceptions.

  2. Add a try/catch statement around calls to the SubmitChanges method of the DataContext object and catch ChangeConflictExceptions.

  3. Override the Update operation of the DataContext object.

Call the ExecuteDynamicUpdate method to generate the update SQL.

  1. Call the SubmitChanges method of the DataContext object.

Pass System.Data.Linq.ConflictMode.ContinueOnConflict to the method.

 

Correct Answer: D

 

 

QUESTION 17

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a multi-tier application. You use Microsoft ADO.NET Entity Data Model (EDM) to model entities. The model contains entities named SalesOrderHeader and SalesOrderDetail. For performance considerations in querying SalesOrderHeader, you detach SalesOrderDetail entities from ObjectContext. You need to ensure that changes made to existing SalesOrderDetail entities updated in other areas of your application are persisted to the database. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

  1. Re-attach the SalesOrderDetail entities.

  2. Set the MergeOption of SalesOrderDetail to MergeOptions.OverwriteChanges.

  3. Set the MergeOption of SalesOrderDetail to MergeOptions.NoTracking.

  4. Call ObjectContext.ApplyCurrentValue.

  5. Call ObjectContext.ApplyOriginalValue.

 

Correct Answer: AE

 

 

QUESTION 18

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 customer and related order records. You add a new order for an existing customer. You need to associate the Order entity with the Customer entity. What should you do?

 

  1. Set the Value property of the EntityReference of the Order entity.

  2. Call the Add method on the EntityCollection of the Order entity.

  3. Use the AddObject method of the ObjectContext to add both Order and Customer entities.

  4. Use the Attach method of the ObjectContext to add both Order and Customer entities.

 

Correct Answer: A

 

 

QUESTION 19

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 over the network. The application uses data from multiple related database tables. You need to ensure that the application can be used if the connection is disconnected or unavailable. Which object type should you use to store data from the database tables?

 

  1. DataSet

  2. DataAdapter

  3. DataReader

  4. Data Services

 

Correct Answer: A

 

 

QUESTION 20

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use a TableAdapter object to load a DataTable object. The DataTable object is used as the data source for a GridView control to display a table of customer information on a Web page. You need to ensure that the application meets the following requirements:

 

  • Load only new customer records each time the page refreshes.

  • Preserve existing customer records.

 

What should you do?

 

  1. Set the ClearBeforeFill property of the TableAdapter to false.

Use the Fill method of the TableAdapter.

 

  1. Set the ClearBeforeFill property of the TableAdapter to false.

Use the GetData method of the TableAdapter to create a new DataTable.

  1. Set the ClearBeforeFill property of the TableAdapter to true.

Use the Fill method of the TableAdapter to load additional customers.

 

  1. Set the ClearBeforeFill property of the TableAdapter to true.

Use the GetData method of the TableAdapter to create a new DataTable.

 

Correct Answer: A

 

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

Try Microsoft MCTS 70-516 Free Demo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.