PrepAway - Latest Free Exam Questions & Answers

Category: 70-516

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

Which code segment should you use?

You use Microsoft .NET Framework 4.0 to develop an ASP.NET 4 Web application.
You need to encrypt the connection string information that is stored in the web.config file. The application is deployed to multiple servers.
The encryption keys that are used to encrypt the connection string information must be exportable and importable on all the servers.
You need to encrypt the connection string section of the web.config file so that the file can be used on all of the servers.
Which code segment should you use?

Which code segment should you use?

You use Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that connects to a Microsoft SQL Server 2008 database.
The application uses Integrated Windows authentication in Internet Information Services (IIS) to authenticate users.
A connection string named connString defines a connection to the database by using integrated security.

You need to ensure that a SqlCommand executes under the application pool’s identity on the database server.
Which code segment should you use?

Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
You use the ADO.NET Entity Framework Designer to model entities. You add the following stored procedure to the database, and you add a function import to the model.

CREATE PROCEDURE [dbo].[InsertDepartment]
@Name nvarchar(50),
@ID int NULL OUTPUT
AS
INSERT INTO Department (Name) VALUES (@Name)
SELECT @ID = SCOPE_IDENTITY()

You need to insert a new department and display the generated ID. Which code segment should you use?

Which line of code should you use?

You use Microsoft .NET Framework 4.0 to develop an application that exposes a WCF Data Services endpoint.
The endpoint uses an authentication scheme that requires an HTTP request that has the following header format.

GET /OData.svc/Products(1)
Authorization: WRAP access_token “123456789”

You add the following method to your DataService implementation.

01 protected override void OnStartProcessingRequest(ProcessRequestArgs args)
02 {
03 ….
04 }

You need to ensure that the method retrieves the authentication token. Which line of code should you use?

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.
The application includes a table adapter named taStore, which has the following DataTable.

image:25.png

There is a row in the database that has a ProductID of 680. You need to change the Name column in the row to “New Product Name”.
Which code segment should you use?

Which code segment should you insert at line 06?

You use Microsoft .NET Framework 4.0 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 Blog newBlog = new Blog();
02 Post newPost = new Post();
03 ….
04 Uri serviceUri = new Uri(“”);
05 BlogsEntities context = new BlogsEntities(serviceUri);
06 ….

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 06?

Which code segment should you place in the entitys partial class?

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.

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 entitys partial class?


Page 2 of 1912345...10...Last »