New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 1-10

Ensurepass

QUESTION 1

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You manually create your own Context class named AdventureWorksDB that inherits from ObjectContext. You need to use AdventureWorksDB to invoke a stored procedure that is defined in the data source. Which method should you call?

 

  1. Translate

  2. ExecuteFunction

  3. ExecuteStoreQuery

  4. ExecuteStoreCommand

 

Correct Answer: B

 

 

QUESTION 2

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 create an entity as shown in the following code fragment.

 

<EntityType Name=”ProductCategory”>

<Key>

<PropertyRef Name=”ProductCategoryID” />

</Key>

<Property Name=”ProductCategoryID” Type=”int” Nullable=”false”

StoreGeneraedPattern=”Identity” />

<Property Name=”ParentProductCategoryID” Type=”int” />

<Property Name=”Name” Type=”nvarchar” Nullable=”false” MaxLength=”50″ /> …

</EntityType>

 

You need to provide two entity-tracking fields:

 

  • Rowguid that is automatically generated when the entity is created

  • ModifiedDate that is automatically set whenever the entity is updated.

 

Which code fragment should you add to the .edmx file?

 

A. <Property Name=”rowguid” Type=”uniqueidentifier” Nullable=”false” StoreGeneratedPattern=”Computed”/> <Property Name=”ModifiedDate” Type=”timestamp” Nullable=”false” StoreGeneratedPattern=”Computed”/>

B. <Property Name=”rowguid” Type=”uniqueidentifier” Nullable=”false” StoreGeneratedPattern=”Identity”/>

<Property Name=”ModifiedDate” Type=”timestamp” Nullable=”false” StoreGeneratedPattern=”Identity”/>

C. <Property Name=”rowguid” Type=”uniqueidentifier” Nullable=”false” StoreGeneratedPattern=”Identity”/> <Property Name=”ModifiedDate” Type=”timestamp” Nullable=”false” StoreGeneratedPattern=”Computed”/>

D. <Property Name=”rowguid” Type=”uniqueidentifier” Nullable=”false” StoreGeneratedPattern=”Computed”/> <Property Name=”ModifiedDate” Type=”timestamp” Nullable=”false” StoreGeneratedPattern=”Identity”/>

Correct Answer: C

 

 

QUESTION 3

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. The service connects to a Microsoft SQL Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 server. You need to ensure that applications authenticate against user information stored in the database before the application is allowed to use the service. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

  1. Configure IIS to require basic authentication.

  2. Configure IIS to allow anonymous access.

  3. Configure IIS to require Windows authentication.

  4. Enable the WCF Authentication Service.

  5. Modify the Data Services service to use a Microsoft ASP.NET membership provider.

 

Correct Answer: BE

 

 

QUESTION 4

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. You discover that when an application submits a PUT or DELETE request to the Data Services service, it receives an error. You need to ensure that the application can access the service. Which header and request type should you use in the application?

 

  1. an X-HTTP-Method header as part of a POST request

  2. an X-HTTP-Method header as part of a GET request

  3. an HTTP ContentType header as part of a POST request

  4. an HTTP ContentType header as part of a GET request

 

Correct Answer: A

 

 

QUESTION 5

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 create classes by using LINQ to SQL based on the records shown in the exhibit:

70-516-demo-2

 

You need to create a LINQ query to retrieve a list of objects that contains the OrderID and CustomerID properties. You need to retrieve the total price amount of each Order record. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

 

  1. from details in dataContext.Order_Detail

group details by details.OrderID

into g

join order in dataContext.Orders on g.Key equals order.OrderID select new

{

OrderID = order.OrderID,

CustomerID = order.CustomerID,

TotalAmount = g.Sum(od => od.UnitPrice * od.Quantity)

}

 

  1. dataContext.Order_Detail.GroupJoin(dataContext.Orders, d => d.OrderID, o => o.OrderID, (dts, ord) => new {

OrderID = dts.OrderID,

CustomerID = dts.Order.CustomerID,

TotalAmount = dts.UnitPrice * dts.Quantity

})

 

  1. from order in dataContext.Orders

group order by order.OrderID into g

join details in dataContext.Order_Detail on g.Key equals details.OrderID select new {

OrderID = details.OrderID,

CustomerID = details.Order.CustomerID,

TotalAmount = details.UnitPrice * details.Quantity

}

 

D. dataContext.Orders.GroupJoin(dataContext.Order_Detail, o => o.OrderID, d => d.OrderID, (ord, dts) => new {

OrderID = ord.OrderID,

CustomerID = ord.CustomerID,

TotalAmount = dts.Sum(od => od.UnitPrice * od.Quantity)

})

Correct Answer: AD

 

 

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. You use the following SQL statement to retrieve an instance of a DataSet object named ds:

 

SELECT CustomerID, CompanyName, ContactName, Address, City

FROM dbo.Customers

 

You need to query the DataSet object to retrieve only the rows where the ContactName field is not NULL. Which code segment should you use?

 

  1. from row in ds.Tables[0].AsEnumerable()

where (string)row[“ContactName”] != null

select row;

 

  1. from row in ds.Tables[0].AsEnumerable()

where row.Field<string>(“ContactName”) != null

select row;

 

  1. from row in ds.Tables[0].AsEnumerable()

where !row.IsNull((string)row[“ContactName”])

select row;

 

  1. from row in ds.Tables[0].AsEnumerable()

where !Convert.IsDBNull(row.Field<string>(“ContactName”))

select row;

 

Correct Answer: B

 

 

QUESTION 7

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. You use Entity SQL to retrieve data from the database. You need to find out whether a collection is empty. Which entity set operator should you use?

 

  1. ANYELEMENT

  2. EXCEPT

  3. EXISTS

  4. IN

 

Correct Answer: C

QUESTION 8

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. You use Entity SQL to retrieve data from the database. You need to enable query plan caching. Which object should you use?

 

  1. EntityCommand

  2. EntityConnection

  3. EntityTransaction

  4. EntityDataReader

 

Correct Answer: A

 

 

QUESTION 9

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?

 

  1. Set the SqlDbType of SqlParameter to Udt.

  2. Set the SqlDbType of SqlParameter to Variant.

  3. Set the ParameterDirection of SqlParameter to Output.

  4. Set the SqlDbType of SqlParameter to Structured. Set the TypeName of SqlParameter to Udt.

 

Correct Answer: D

 

 

QUESTION 10

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 use a spatial value type as a parameter for your database query. What should you do?

 

  1. Set the parameter’s SqlDbType to Binary.

  2. Set the parameter’s SqlDbType to Variant.

  3. Set the parameter’s SqlDbType to Udt. Set the parameter’s UdtTypeName to GEOMETRY.

  4. Set the parameter’s SqlDbType to Structured. Set the parameter’s TypeName to GEOMETRY.

 

Correct Answer: C

 

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

Try Microsoft MCTS 70-516 Free Demo