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?
A. Translate
B. ExecuteFunction
C. ExecuteStoreQuery
D. ExecuteStoreCommand
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"/>
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.)
A. Configure IIS to require basic authentication.
B. Configure IIS to allow anonymous access.
C. Configure IIS to require Windows authentication.
D. Enable the WCF Authentication Service.
E. Modify the Data Services service to use a Microsoft ASP.NET membership provider.
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?
A. an X-HTTP-Method header as part of a POST request
B. an X-HTTP-Method header as part of a GET request
C. an HTTP ContentType header as part of a POST request
D. an HTTP ContentType header as part of a GET request
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:
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.)
A. 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)
}
B. 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
})
C. 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)
})
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?
A. from row in ds.Tables[0].AsEnumerable()
where (string)row["ContactName"] != null
select row;
B. from row in ds.Tables[0].AsEnumerable()
where row.Field<string>("ContactName") != null
select row;
C. from row in ds.Tables[0].AsEnumerable()
where !row.IsNull((string)row["ContactName"])
select row;
D. from row in ds.Tables[0].AsEnumerable()
where !Convert.IsDBNull(row.Field<string>("ContactName"))
select row;
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?
A. ANYELEMENT
B. EXCEPT
C. EXISTS
D. IN
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?
A. EntityCommand
B. EntityConnection
C. EntityTransaction
D. EntityDataReader
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?
A. Set the SqlDbType of SqlParameter to Udt.
B. Set the SqlDbType of SqlParameter to Variant.
C. Set the ParameterDirection of SqlParameter to Output.
D. Set the SqlDbType of SqlParameter to Structured. Set the TypeName of SqlParameter to Udt.
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?
A. Set the parameter’s SqlDbType to Binary.
B. Set the parameter’s SqlDbType to Variant.
C. Set the parameter’s SqlDbType to Udt. Set the parameter’s UdtTypeName to GEOMETRY.
D. Set the parameter’s SqlDbType to Structured. Set the parameter’s TypeName to GEOMETRY.
Answer: C
Pass Your Exam On First Try Real Microsoft 70-516 Exam Braindumps