Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Microsoft TS: Accessing Data with Microsoft .NET Framework 4 (70-516) Free Practice Test

Question 1
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database.
SQLConnection conn = new SQLConnection(connectionString);
conn.Open();
SqlTransaction tran = db.BeginTransaction(IsolationLevel. ...);
...
You must retrieve not commited records originate from various transactions. Which method should you use?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the Entity Framework Designer to create an Entity Data Model (EDM).
You need to create a database creation script for the EDM. What should you do?

Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. The database includes a table that
contains information about all the employees.
The database table has a field named EmployeeType that identifies whether an employee is a Contractor or
a Permanent employee.
You declare the Employee entity base type. You create a new Association entity named Contractor that
inherits the Employee base type.
You need to ensure that all Contractors are bound to the Contractor class. What should you do?

Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database.
The Data Definition Language (DDL) script of the database contains the following code segment:
CREATE TABLE [Sales].[SalesOrderHeader]( [SalesOrderID] [int] IDENTITY(1,1) NOT NULL, [BillToAddressID] [int] NOT NULL, ... CONSTRAINT [PK_SalesOrderHeader_SalesOrderID] PRIMARY KEY CLUSTERED ([SalesOrderID] ASC) )
ALTER TABLE [Sales].[SalesOrderHeader] WITH CHECK ADD CONSTRAINT [FK_SalesOrderHeader_Address] FOREIGN KEY([BilIToAddressID]) REFERENCES [Person].[Address]([AddressID])
You create an ADO.NET Entity Framework model. You need to ensure that the entities of the model
correctly map to the DDL of the database.
What should your model contain?

Correct Answer: A
Question 5
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application uses the ADO.NET Entity Framework to manage Plain Old CLR Objects (POCO) entities.
You create a new POCO class. You need to ensure that the class meets the following requirements:
-It can be used by an ObjectContext.
-It is enabled for change-tracking proxies.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Correct Answer: D,E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database.
The application has two DataTable objects that reference the Customers and Orders tables in the
database.
The application contains the following code segment. (Line numbers are included for reference only.)
01 DataSet customerOrders = new DataSet();
02 customerOrders.EnforceConstraints = true;
03 ForeignKeyConstraint ordersFK = new ForeignKeyConstraint("ordersFK",
04 customerOrders.Tables
["Customers"].Columns["CustomerID"],
05 customerOrders.Tables["Orders"].Columns
["CustomerID"]);
06 ...
07 customerOrders.Tables["Orders"].Constraints.Add(ordersFK);
You need to ensure that an exception is thrown when you attempt to delete Customer records that have
related Order records.
Which code segment should you insert at line 06?

Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 7
You use Microsoft Visual studio 2010 and Microsoft NET Framework 4.0 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?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server
2008 database.
You add the following table to the database.
CREATE TABLE Orders( ID numeric(18, 0) NOT NULL, OrderName varchar(50) NULL, OrderTime time(7) NULL, OrderDate date NULL)
You write the following code to retrieve data from the OrderTime column. (Line numbers are included for reference only.)
01 SqlConnection conn = new SqlConnection("...");
02 conn.Open();
03 SqlCommand cmd = new SqlCommand("SELECT ID, OrderTime FROM Orders", conn);
04 SqlDataReader rdr = cmd.ExecuteReader();
05 ....
06 while(rdr.Read())
07 {
08 ....
09 }
You need to retrieve the OrderTime data from the database. Which code segment should you insert at line 08?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 9
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that connects to a MS SQL server 2008 database by User Authentication. The application contains the following connection string:
SERVER=DBSERVER-01; DATABASE=pubs; uid=sa; pwd=secret;
You need to ensure that the password value in the connection string property of a SqlConnection object
does not exist after is called.
What should you add to the connection string?

Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).