PrepAway - Latest Free Exam Questions & Answers

Category: 70-516

Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4

What should you do?

You use Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The LINQ to SQL model contains the Product entity.
A stored procedure named GetActiveProducts performs a query that returns the set of active products from the database.
You need to invoke the stored procedure to return the active products, and you must ensure that the LINQ to SQL context can track changes to these entities. What should you do?

Which code segment should you use in the Initialize method?

You are developing a WCF data service that will expose an existing Entity Data Model (EDM).
You have the following requirements:
* Users must be able to read all entities that are exposed in the EDM.
* Users must be able to update or replace the SalesOrderHeader entities.
* Users must be prevented from inserting or deleting the SalesOrderHeader entities

You need to ensure that the data service meets the requirements. Which code segment should you use in the Initialize method?

What should you do?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to several SQL Server databases. You create a function that modifies customer records that are stored in multiple databases.
All updates for a given record are performed in a single transaction. You need to ensure that all transactions can be recovered. What should you do?

Which code segment should you insert at line 04?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
Entity types in the model are generated by the Entity Data Model generator tool (EdmGen.exe).
You write the following code. (Line numbers are included for reference only.)

01 MemoryStream stream = new MemoryStream();
02 var query = context.Contacts.Include(SalesOrderHeaders.SalesOrderDetails);
03 var contact = query.Where(it.LastName = @lastname, new ObjectParameter(lastname, lastName)).First();
04 ….

You need to serialize the contact and all of its related objects to the MemoryStream so that the contact can be deserialized back into the model.
Which code segment should you insert at line 04?

What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
The application uses nested transaction scopes. An inner transaction scope contains code that inserts records into the database.
You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls back.

What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this goal?
(Each correct answer presents a complete solution. Choose two.)

Which code segment should you use?

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
You add the following stored procedure to the database.

CREATE PROCEDURE dbo.GetClassAndStudents
AS
BEGIN
SELECT * FROM dbo.Class
SELECT * FROM dbo.Student
END

You create a SqIConnection named conn that connects to the database.
You need to fill a DataSet from the result that is returned by the stored procedure.
The first result set must be added to a DataTable named Class, and the second result set must be added to a DataTable named Student.
Which code segment should you use?


Page 4 of 19« First...23456...10...Last »