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)

What are two possible ways to achieve this goal?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server 2008 database. You create classes by using LINQ to
SQL based on the records shown in the exhibit. (Click the Exhibit button.)

You need to create a LINQ query to retrieve a list of objects that contains the OrderID and
CustomerID properties. You need to retrieve the total price amount of each Order record. What are
two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose
two.)

Which code segment should you insert at line 03?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application contains the following XML document.
<bib>
<book title=”TCP/IP Illustrated” year=”1994″>
<author> Author1 </author>
</book>
<book title=”Programming in Unix” year=”1992″>
<author> Author1 </author>
<author> Author2 </author>
<author> Author3 </author>
</book>
<book title=”Data on the Web” year=”2000″>
<author> Author4 </author>
<author> Author3 </author>
</book>
</bib>
You add the following code fragment. (Line numbers are included for reference only.)
01 Public Function GetBooks(xml As String) As IEnumerable(Of XElement)
02 Dim doc As XDocument = XDocument.Parse(xml)
03
04 End Function
You need to return a list of book XML elements that are authored by Author1. Which code segment
should you insert at line 03?

Which code segment should you insert at line 09?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server 2008 database. The database includes a database
table named ProductCatalog as shown in the exhibit. (Click the Exhibit button.)

You add the following code segment to query the first row of the ProductCatalog table. (Line
numbers are included for reference only.)
01 Using cnx As var = New SqlConnection(connString)
02 Dim command As var = cnx.CreateCommand()
03 command.CommandType = CommandType.Text
04 command.CommandText = “SELECT TOP 1 * FROM dbo.ProductCatalog”
05 cnx.Open()
06 Dim reader As var = command.ExecuteReader()
07 If reader.Read() Then
08 Dim id As var = reader.GetInt32(0)
09
10 reader.Close()
11 End If
12 End Using
You need to read the values for the Weight, Price, and Status columns. Which code segment should
you insert at line 09?

What are two possible code segments that you can use to achieve this goal?

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 GetProducts
AS
BEGIN

SELECT ProductID, Name, Price, Cost
FROM Product END
You create a SqlDataAdapter named adapter to execute the stored procedure. You need to fill a
DataTable instance with the first 10 rows of the result set. What are two possible code segments
that you can use to achieve this goal? (Each correct answer presents a complete solution. Choose
two.)

You need to add the property to Product

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the Entity Framework Designer to create an Entity Data Model from an existing database by
using the Generate from database wizard. The model contains an entity type named Product. The
Product type requires an additional property that is not mapped to a database column. You need to
add the property to Product. What should you do?

Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server database. You use the ADO.NET LINQ to SQL model
to retrieve data from the database. The application contains the Category and Product entities, as
shown in the following exhibit.

You need to ensure that LINQ to SQL executes only a single SQL statement against the database. You
also need to ensure that the query retrieves the list of categories and the list of products. Which
code segment should you use?

You need to ensure that the entity that is mapped to the ContentTypeDerived table derives from the entity that

You use the Microsoft .NET Framework 4 Entity Framework to develop an application that contains
an Entity Data Model for the following database tables.

You need to ensure that the entity that is mapped to the ContentTypeDerived table derives from the
entity that is mapped to the ContentTypeBase table. What should you do?

You need to add a function that returns the number of years since a person was hired

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application uses the ADO.NET Entity Framework to model entities. The model includes the entity
shown in the following exhibit.

You need to add a function that returns the number of years since a person was hired. You also need
to ensure that the function can be used within LINQ to Entities queries. 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.
You use the ADO.NET Entity Framework Designer to model entities. The application includes two
ObjectContext instances named context1 and context2. You need to persist the changes in both
object contexts within a single transaction. Which code segment should you use?

You need to ensure that when the user connects to the central data store and retrieves new data…

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application uses the ADO.NET Entity Framework to model entities. The application allows users to
make changes to entities while disconnected from the central data store. You need to ensure that
when the user connects to the central data store and retrieves new data, the application meets the
following requirements:
• Changes made to the local data store in disconnected mode are preserved.
• Entities that have already been loaded into the local data store, but have not been modified by the
user, are updated with the latest data.
What should you do?


Page 24 of 31« First...10...2223242526...30...Last »