Microsoft TS: Accessing Data with Microsoft .NET Framework 4 - 070-516 Exam Practice Test
You use Microsoft .NET Framework 4.0 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.GetClassAndStudents AS BEGIN
SELECT * FROM dbo.Class
SELECT * FROM dbo.Student
END
You create a SqIConnection 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?
2008 database.
You add the following stored procedure to the database.
CREATE PROCEDURE dbo.GetClassAndStudents AS BEGIN
SELECT * FROM dbo.Class
SELECT * FROM dbo.Student
END
You create a SqIConnection 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?
Correct Answer: C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application updates several Microsoft SQL Server databases within a single transaction.
You need to ensure that after a resource failure, you can manage unresolved transactions. What should
you do?
The application updates several Microsoft SQL Server databases within a single transaction.
You need to ensure that after a resource failure, you can manage unresolved transactions. What should
you do?
Correct Answer: A
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
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.
-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.
Correct Answer: C
Vote an answer
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities.
You need to create a Plain Old CLR Object (POCO) class that can be used with the
ObjectContext.CreateObject method to create a proxy.
What should you do?
You use the ADO.NET Entity Framework Designer to model entities.
You need to create a Plain Old CLR Object (POCO) class that can be used with the
ObjectContext.CreateObject method to create a proxy.
What should you do?
Correct Answer: B
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
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 entity's partial class?

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 entity's partial class?
Correct Answer: D
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You are developing an ADO.NET 4.0 application that interacts with a Microsoft SQL Server 2008 server
through the SQL Server Native Client.
You create a trace DLL registry entry and you register all of the trace schemas.
You need to trace the application data access layer. Which control GUID file should you use?
through the SQL Server Native Client.
You create a trace DLL registry entry and you register all of the trace schemas.
You need to trace the application data access layer. Which control GUID file should you use?
Correct Answer: C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
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.
You need to create a database from your model. What should you do?
The application uses the ADO.NET Entity Framework to model entities.
You need to create a database from your model. What should you do?
Correct Answer: B
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
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.
You need to ensure that the application calls a stored procedure that accepts a table-valued parameter.
You create a SqlParameter object. What should you do next?
The application connects to a Microsoft SQL Server 2008 database.
You need to ensure that the application calls a stored procedure that accepts a table-valued parameter.
You create a SqlParameter object. What should you do next?
Correct Answer: D
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows
Communication Foundation (WCF) Data Services service.
WCF Data Services 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"
The application includes the following code. (Line numbers are included for reference only.)
01 public class program
02 {
03 Public void GetProducts()
04 {
05 var proxy = new MyDataServiceContext("...");
06 ...
07 }
08 }
You need to ensure that the correct authentication header is present when requests are made by using
MyDataServiceContext.
What should you do?
Communication Foundation (WCF) Data Services service.
WCF Data Services 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"
The application includes the following code. (Line numbers are included for reference only.)
01 public class program
02 {
03 Public void GetProducts()
04 {
05 var proxy = new MyDataServiceContext("...");
06 ...
07 }
08 }
You need to ensure that the correct authentication header is present when requests are made by using
MyDataServiceContext.
What should you do?
Correct Answer: C
Vote an answer
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You use Microsoft ADO.NET Entity Data Model (EDM) to model entities.
You create an entity named Person with a schema defined by the following XML fragment.
<EntityType Name="CPerson"> <Key> <PropertyRef Name="PersonId" /> </Key>
<Property Name="PersonId" Type="Int32" Nullable="false" />
<Property Name="CompanyName" Type="String" />
<Property Name="ContactName" Type="String" />
<Property Name="ContactTitle" Type="String" />
<Property Name="Address" Type="String" />
</EntityType>
You need to ensure that entities within the application are able to add properties related to the city, region,
and country of Person's address.
What should you do?
You use Microsoft ADO.NET Entity Data Model (EDM) to model entities.
You create an entity named Person with a schema defined by the following XML fragment.
<EntityType Name="CPerson"> <Key> <PropertyRef Name="PersonId" /> </Key>
<Property Name="PersonId" Type="Int32" Nullable="false" />
<Property Name="CompanyName" Type="String" />
<Property Name="ContactName" Type="String" />
<Property Name="ContactTitle" Type="String" />
<Property Name="Address" Type="String" />
</EntityType>
You need to ensure that entities within the application are able to add properties related to the city, region,
and country of Person's address.
What should you do?
Correct Answer: C
Vote an answer