PrepAway - Latest Free Exam Questions & Answers

Tag: 70-516

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

Which code segment should you insert at line 03?

You use Microsoft .NET Framework 4.0 to develop an application.
You write the following code to update data in a Microsoft SQL Server 2008 database.
(Line numbers are included for reference only.)

01 private void ExecuteUpdate(SqlCommand cmd, string connString, string updateStmt)
02 {
03 …
04 }

You need to ensure that the update statement executes and that the application avoids connection leaks.
Which code segment should you insert at line 03?

Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
The application defines the following Entity Data Model.

Within the .edmx file, the following function is defined:

<Function Name=Round ReturnType=Decimal>
<Parameter Name=val Type=Decimal />
<DefiningExpression>
CAST(val as Edm.Int32)
</DefiningExpression>
</Function>

The application includes the following LINQ query.

var query = from detail in context.SalesOrderDetails
select detail.LineTotal.Round();

You need to ensure that the Round function executes on the database server when the query is executed.
Which code segment should you use?

What should you do?

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

The application contains a class as shown in the following code segment. (Line numbers are included for reference only.)

01 public class MyBaseClass : EntityObject
02 {
03 .
04 }

You need to ensure that all generated entities inherit from MyBaseClass. What should you do?

What should you do?

You use Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL.
The Product entity in the LINQ to SQL model contains a field named Productlmage. The Productlmage field holds a large amount of binary data.
You need to ensure that the Productlmage field is retrieved from the database only when it is needed by the application. What should you do?

What should you do to to ensure that database users can view the original row values?

You add a table to the database to track changes to part names. The table stores the following row values:
* the username of the user who made the change
* a part ID
* the new part name
* a DateTime value

You need to ensure detection of unauthorized changes to the row values.
You also need to ensure that database users can view the original row values.

Which query parts should you use in sequence to complete the expression?

The user interface requires that a paged view be displayed of all the products sorted in alphabetical order.
The user interface supplies a current starting index and a page size in variables named startIndex and pageSize of type int.
You need to construct a LINQ expression that will return the appropriate Parts from the database from an existing
ContosoEntities context object named context. You begin by writing the following expression:
context.Parts

Which query parts should you use in sequence to complete the expression?
(To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)


Page 5 of 19« First...34567...10...Last »