PrepAway - Latest Free Exam Questions & Answers

Category: 70-516 (v.2)

Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4 (update October 26th, 2015)

Which code segment should you use?

You use Microsoft .NET Framework 4 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 SqIGonnection 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?

You need to ensure that a stored procedure will be invoked when the ObjectContext.SaveChanges method is execut

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities. The model contains an entity
type named Product. You need to ensure that a stored procedure will be invoked when the
ObjectContext.SaveChanges method is executed after an attached Product has changed. What
should you do in the ADO.NET Entity Framework Designer?

Which code segment should you place in the entity’s partial class?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the Entity Framework Designer to create the following Entity Data Model.

You write a method named ValidatePostalCode to validate the postal code for the application.
You need to ensure that the ValidatePostalCode method is called before the PostalCode property set
method is completed and before the underlying value has changed. Which code segment should you
place in the entity’s partial class?

Which code segment should you use?

You use Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The
application defines the following Entity SQL (ESQL) query, which must be executed against the mode.
string prodQuery = “select value p from Products as
p where p.ProductCategory.Name = @p0″;
You need to execute the query.
Which code segment should you use?

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

You use Microsoft .NET Framework 4 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 insert at line 04?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 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.LostName = Glostname”,
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?

Which storage Model section of the .edmx file should you include?

You use Microsoft Visual Studio 2010 to create a Microsoft .NET Framework 4 application. You
create an Entity Data Model for the database tables shown in the following diagram.

You need to modify the .edmx file so that a many-to-many association can exist between the
Address and Customer entities. Which storage Model section of the .edmx file should you include?


Page 10 of 31« First...89101112...2030...Last »