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 insert at line 07?

You use Microsoft .NET Framework 4 to develop an application that uses WCF Data Services to
persist entities from the following Entity Data Model.

You create a new Blog instance named newBlog and a new Post instance named newPost as shown
in the following code segment. (Line numbers are included for reference only.)
01 Dim newBlog As Blog = New Blog()
02 Dim newPost As Post = New Post ()
03 —
04 Dim serviceUri As Uri – New Uri(“—”)
05 Dim context As BlogsEntities =
06 New BlogsEntities (serviceUri) 07
You need to ensure that newPost is related to newBlog through the Posts collection property and
that newPost and newBlog are sent to the service. Which code segment should you insert at line 07?

Which MergeOption enumeration value should you use to retrieve the entity?

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. You need to retrieve an entity,
and you must ensure that the entity is loaded in a detached state. Which MergeOption enumeration
value should you use to retrieve the entity?

Which code segment should you insert at line 04?

You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database You populate a SqlDataAdapter by using the following code. (Line numbers are
included for reference only.)
01 Dim dataAdapterl As SqlDataAdapter = New SqlDataAdapter(
“SELECT * FROM [BlogEntries] ” &_
“ORDER BY CreationDate”, connection)

02 cindBuilder = New SqlCoittnandBuilder (dataAdapterl)
03 dataAdapter1.Fill(BlogEntryDataSet, “BlogEntries”) 04
05 connection.Close()
You need to update the blog owner for all BlogEntry records.
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?

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.GetClossAndStudents
AS
BEGIN

SELECT * FROM ctoo.Class
SELECT * FROM dbo.Student
END
You create a SqlConnection 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 create a query that generates the new XML result.

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application. A
file named books.xml contains the following XML.
<bib>
<book title=”Programming in Unix” year=”1992″>
<author>Author1</author>
<author>Author2</author>
<author> Author 3 </out hor>
</book>
</bib>

The application must generate an XML result that contains an XML element named BookTitle for
each book. The text content of the element must contain the title of the book. You need to create a
query that generates the new XML result.

You need to ensure that the edm contains an entity type named employee that contains all of the data from both

You use microsoft visual studio 2010 and microsoft .net framework 4 to create an application that
connects to a database by using the entity framework. you create an entity data model (edm) by
using the generate from database wizard for the following tables.

You need to ensure that the edm contains an entity type named employee that contains all of the
data from both tables. What should you do?

Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses LINQ to SQL. The application contains the following model.

Each region contains a single vendor. Customers order parts from the vendor that is located in their
region. You need to ensure that each row in the Customer table references the appropriate row
from the Vendor table. Which code segment should you use?

What are two possible TransoctionScope 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
TransoctionScope constructors that you can use for the inner transaction to achieve this goal? (Each
correct answer presents a complete solution. Choose two.)

You need to invoke the stored procedure to return the active products, and you must ensure that the UNQ to SQL

You use Microsoft .NET Framework 4 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 UNQ to SQL context can track changes to these entities. What should you do?


Page 27 of 31« First...1020...2526272829...Last »