Microsoft TS: Accessing Data with Microsoft .NET Framework 4 認定 70-516 試験問題:
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 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) IN
B) EXCEPT
C) EXISTS
D) ANYELEMENT
2. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows
Communication
Foundation (WCF) Data Services service. You deploy the data service to the following URL: http://
contoso.com/Northwind.svc.
You need to update the City property of the Customer record that has its ID value as 123.
You also need to preserve the current values of the remaining properties. Which HTTP request should you
use?
A) PUT /Northwind.svc/Customers(123) Host: contoso.com Accept: application/json { City: 'Seattle' }
B) MERGE /Northwind.svc/Customers(123) Host: contoso.com
Content-Type: application/json { City: 'Seattle' }
C) PUT /Northwind.svc/Customers(123) Host: contoso.com Content-Type: application/json { City: 'Seattle' }
D) MERGE /Northwind.svc/Customers(123) Host: contoso.com Accept: application/json { City: 'Seattle' }
3. You develop a Microsoft .NET application that uses Entity Framework to store entities in a Microsft SQL
Server 2008 database.
While the application is disconnected from the database, entities that are modified, are serialized to a local
file.
The next time the application connects to the database, it retrieves the identity from the database by using
an object context
named context and stores the entity in a variable named remoteCustomer.
The application then serializes the Customer entity from the local file and stores the entity in a variable
named localCustomer.
The remoteCustomer and the localCustomer variables have the same entity key.
You need to ensure that the offline changes to the Customer entity is persisted in the database when the
ObjectContext.SaveChanges() method is called.
Which line of code should you use?
A) context.ApplyCurrentValues("Customers", localCustomer);
B) context.ApplyOriginalValues("Customers", localCustomer);
C) context.ApplyOriginalValues("Customers", remoteCustomer);
D) context.ApplyCurrentValues("Customers", remoteCustomer);
4. You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server
2008 database.
The database contains a ClassStudent table that contains the StudentID for students who are enrolled in
the classes.
You add the following stored procedure to the database.
CREATE PROCEDURE [dbo].[GetNumEnrolled] @ClassID INT, @NumEnrolled INT OUTPUT
AS BEGIN SET NOCOUNT ON SELECT @NumEnrolled = COUNT(StudentID)
FROM ClassStudent
WHERE (ClassID = @ClassID)
END
You write the following code. (Line numbers are included for reference only.)
01 private int GetNumberEnrolled(string classID)
02 {
03 using (SqlConnection conn = new SqlConnection(GetConnectionString())
04 {
05 SqlCommand cmd = new SqlCommand("GetNumEnrolled", conn);
06 cmd.CommandType = CommandType.StoredProcedure;
07 SqlParameter parClass = cmd.Parameters.Add("@ClassID", SqlDbType.Int,
4, "classID");
08 SqlParameter parNum = cmd.Parameters.Add("@NumEnrolled",
SqlDbType.Int);
09 ...
10 conn.Open()
11 ...
12 }
13 }
You need to ensure that the GetNumberEnrolled method returns the number of students who are enrolled
for a specific class.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A) Insert the following code at line 09.
parNum.Direction = ParameterDirection.Input;
B) Insert the following code at line 11.
int numEnrolled = 0;
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
numEnrolled = numEnrolled + (int)cmd.Parameters["@NumEnrolled"].Value; } return numEnrolled;
C) Insert the following code at line 11.
cmd.ExecuteNonQuery();
return (int)parNum.Value;
D) Insert the following code at line 09.
parNum.Direction = ParameterDirection.Output;
5. 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.
The application contains a class as shown in the following code segment. (Line numbers are included for
reference only.)
01 public class MyBaseClass : EntityObject
02 {
03 ....
04 }
You need to ensure that all generated entities inherit from MyBaseClass. What should you do?
A) Change MyBaseClass to inherit from ObjectContext.
B) Create a new ObjectQuery that uses MyBaseClass as the type parameter.
C) Modify the generated code file so that all entities inherit from MyBaseClass.
D) Use the ADO.NET EntityObject Generator template to configure all entities to inherit from MyBaseClass.
質問と回答:
| 質問 # 1 正解: C | 質問 # 2 正解: B | 質問 # 3 正解: A | 質問 # 4 正解: C、D | 質問 # 5 正解: D |














832 お客様のコメント
品質保証JPexamはIT認定試験のシラバスに従って、試験問題の範囲を正確に絞って、的中率が99%の最新問題集を捧げます。
1年間の無料更新サービスJPexamは1年以内に問題集の無料更新サービスを提供し、お客様がいつでも最新版の問題集を持つことを保証いたします。もし試験の内容が変更されたら、弊社は直ちにお客様にお知らせします。それに、弊社の問題集が更新されたら、早速メールで最新バージョンを送付いたします。
全額返金JPexamの問題集を利用すると、短時間で勉強しても試験に合格できるのを保証いたします。試験に不合格になってしまった場合、弊社は全額返金いたします。(
ご購入前のお試しJPexamは問題集のサンプルを無料で提供いたします。ご購入前にサンプルを試用して製品の品質を確認することができます。ご遠慮なく利用してください。
