Home » New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 171-180

New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 171-180

Ensurepass

QUESTION 171

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?

 

  1. Use a new Self-Tracking Entities template.

  2. Drag entities to Server Explorer.

  3. Run the Generate Database command.

  4. Select Run Custom Tool from the solution menu.

 

Correct Answer: C

 

 

QUESTION 172

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You need to ensure that the application connects to the database server by using SQL Server authentication. Which connection string should you use?

A. SERVER=MyServer; DATABASE=AdventureWorks; Integrated Security=SSPI; UID=sa; PWD=secret;

B. SERVER=MyServer; DATABASE=AdventureWorks; UID=sa; PWD=secret;

C. SERVER=MyServer; DATABASE=AdventureWorks; Integrated Security=false;

D. SERVER=MyServer; DATABASE=AdventureWorks; Trusted Connection=true;

 

Correct Answer: B

 

 

QUESTION 173

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?

 

 

  1. DataSet ds = new DataSet();

SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);

ds.Tables.Add(“Class”);

ds.Tables.Add(“Student”);

ad.Fill(ds);

 

  1. DataSet ds = new DataSet();

SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);

ad.TableMappings.Add(“Table”, “Class”);

ad.TableMappings.Add(“Table1”, “Student”);

ad.Fill(ds);

 

  1. DataSet ds = new DataSet();

SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);

ad.MissingMappingAction = MissingMappingAction.Ignore;

ad.Fill(ds, “Class”);

ad.Fill(ds, “Student”);

 

  1. DataSet ds = new DataSet();

SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);

ad.Fill(ds);

 

Correct Answer: B

 

 

QUESTION 174

You use Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application defines the following Entity SQL (ESQL) query, which must be executed against the mode.

 

string prodQuery = “select value p from Products as p where p.ProductCategory. Name = @p0″;

 

You need to execute the query. Which code segment should you use?

 

  1. var prods = ctx.CreateQuery<Product>(prodQuery, new ObjectParameter(“p0″, “Road Bikes”)).ToList();

  2. var prods = ctx.ExecuteStoreCommand(prodQuery, new ObjectParameter(“p0″, “Road Bikes”)).ToList();

  3. var prods = ctx.ExecuteFunction<Product>(prodQuery, new ObjectParameter(“p0″, “Road Bikes”)).ToList();

  4. var prods = ctx.ExecuteStoreQuery<Product>(prodQuery, new ObjectParameter(“p0″, “Road Bikes”)). ToList();

 

Correct Answer: A

 

 

QUESTION 175

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. The application uses nested transaction scopes. An inner transaction scope contains code that inserts records into the database. You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls back. What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

 

  1. TransactionScope(TransactionScopeOption.Required)

  2. TransactionScope()

  3. TransactionScope(TransactionScopeOption.RequiresNew)

  4. TransactionScope(TransactionScopeOption.Suppress)

 

Correct Answer: CD

 

 

QUESTION 176

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?

  1. Modify the .edmx file to include the following line of code:

<NavigationProperty Name=”Type” FromRole=”EmployeeType” ToRole=”Contractor” />

  1. Modify the .edmx file to include the following line of code:

<Condition ColumnName=”EmployeeType” Value=”Contractor” />

  1. Use the Entity Data Model Designer to set up an association between the Contractor class and EmployeeType.

  2. Use the Entity Data Model Designer to set up a referential constraint between the primary key of the Contractor class and EmployeeType.

 

Correct Answer: B

 

 

QUESTION 177

You use Microsoft Visual Studio 2010 and Microsoft ADO.NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET LINQ to SQL model to retrieve data from the database. You use stored procedures to return multiple result sets. You need to ensure that the result sets are returned as strongly typed values. What should you do?

 

  1. Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function.

Use the GetResult<TElement> method to obtain an enumerator of the correct type.

  1. Apply the FunctionAttribute and ParameterAttribute to the stored procedure function and directly access the strongly typed object from the results collection.

  2. Apply the ResultTypeAttribute to the stored procedure function and directly access the strongly typed object from the results collection.

  3. Apply the ParameterAttribute to the stored procedure function.

Use the GetResult<TElement> method to obtain an enumerator of the correct type.

 

Correct Answer: A

 

 

QUESTION 178

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You create stored procedures by using the following signatures:

 

CREATE procedure [dbo].[Product_Insert](@name varchar(50),@price float)

CREATE procedure [dbo]. [Product_Update](@id int, @name varchar(50), @price float)

CREATE procedure [dbo].[Product_Delete](@id int)

CREATE procedure [dbo].[Order_Insert](@productId int, @quantity int)

CREATE procedure [dbo]. [Order_Update](@id int, @quantity int,@originalTimestamp timestamp)

CREATE procedure [dbo].[Order_Delete](@id int)

 

You create a Microsoft ADO.NET Entity Data Model (EDM) by using the Product and Order entities as shown in the exhibit:

 

70-516-demo-24

 

You need to map the Product and Order entities to the stored procedures. To which two procedures should you add the @productId parameter? (Each correct answer presents part of the solution. Choose two.)

 

A. Product_Delete

B. Product_Update

C. Order_Delete

D. Order_Update

 

Correct Answer: CD

 

 

QUESTION 179

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use Plain Old CLR objects (POCO) to model your entities. The application communicates with a Windows Communication Foundation (WCF) Data Services service. You need to ensure that entities can be sent to the service as XML. What should you do?

 

  1. Apply the virtual keyword to the entity properties.

  2. Apply the [Serializable] attribute to the entities.

  3. Apply the [DataContract(IsReference = true)] attribute to the entities.

  4. Apply the [DataContract(IsReference = false)] attribute to the entities.

 

Correct Answer: C

 

 

QUESTION 180

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 dat
abase from your model. What should you do?

 

  1. Run the edmgen.exe tool in FullGeneration mode.

  2. Run the edmgen.exe tool in FromSSDLGeneration mode.

  3. Use the Update Model Wizard in Visual Studio.

  4. Use the Generate Database Wizard in Visual Studio. Run the resulting script against a Microsoft SQL Server database.

 

Correct Answer: D

 

Instant Access to Download Latest Complete Collection of Microsoft MCTS 70-516 Real Exam

Try Microsoft MCTS 70-516 Free Demo

HOT EXAM!
New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 181-190
New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 161-170

Name of author

Name: admin