Jan 17

MCITP Certification, 70-680 Windows 7 Configuration Eaxm

QUESTION NO: 1

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You create the classes shown in the following exhibit.

You add the following code segment to the application. (Line numbers are included for reference only.) MCITP Certification

01public void QueryPlayers (Listleagues)

02

03

You create a LINQ query to retrieve a collection of Player objects.

You need to ensure that the collection includes all the players from each team and every league. Which code segment should you insert at line 02

A. var query = leagues.Select (l => l.Teams.Select (t => t.Players ));

B. var query = leagues.Select (l => l.Teams.SelectMany (t => t.Players ));

C. var query = leagues.SelectMany (l => l.Teams.SelectMany (t => t.Players ));

D. var query = leagues.SelectMany (l => l.Teams.Select (t => t.Players ));

Answer: C
Explanation:

QUESTION NO: 2

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 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?

169

A. PUT /Northwind.svc/Customers(123)
Host: contoso.com
Content-Type: application/json

City: 'Seattle'

B. PUT /Northwind.svc/Customers(123)
Host: contoso.com
Accept: application/json

City: 'Seattle'

C. MERGE /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'

Answer: C
Explanation:

QUESTION NO: 3

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. The application uses a DataTable named OrderDetailTable that has the following columns:

ID

OrderID

ProductID

Quantity LineTotal

Some records contain a null value in the LineTotal field and 0 in the Quantity field.

170

You write the following code segment. (Line numbers are included for reference only.) 01DataColumn column = new DataColumn("UnitPrice", typeof(double));

02

03OrderDetailTable.Columns.Add(column);

You need to add a calculated DataColumn named UnitPrice to the OrderDetailTable object. You also need to ensure that UnitPrice is set to 0 when it cannot be calculated.

Which code segment should you insert at line 02?

A. column.Expression = "LineTotal/Quantity";

B. column.Expression = "LineTotal/ISNULL(Quantity, 1)";

C. column.Expression = "if(Quantity > 0, LineTotal/Quantity, 0)";

D. column.Expression = "iif(Quantity > 0, LineTotal/Quantity, 0)";

Answer: D
Explanation:

Jan 16

MCITP Certification, Exam 70 680 Training

QUESTION NO: 1

You use Microsoft .NET Framework 4 to develop an application that uses WCF Data Services to retrieve entities. MCITP Certification

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 Sub GetProducts()

85

04

05 Dim proxy = New MyDataServiceContext()

06

07

08 End Sub

09

10 End Class

You need to ensure that the correct authentication header is present when requests are made by using MyDataServiceContext.

What should you do?

A. Insert the following code segment at line 06.
proxy.Credentials = New NetworkCredential( _
"WRAP access_token", "123456789")

B. Insert the following code segment at line 06.
proxy.Credentials = New NetworkCredential( _
"Authorization", "WRAP access_token=""123456789""")

C. Insert the following code segment at line 06.
AddHandler proxy.SendingRequest, New _
EventHandler(Of SendingRequestEventArgs)( _
AddressOf proxy_SendingRequest)
Insert the following code segment at line 09.
Sub proxy_SendingRequest(ByVal sender As Object,
ByVal e As SendingRequestEventArgs)

D. RequestHeaders.Add("WRAP access_token", "123456789")
End Sub

E. Insert the following code segment at line 06.
AddHandler proxy.SendingRequest, New EventHandler(
Of SendingRequestEventArgs)( _
AddressOf proxy_SendingRequest)
Insert the following code segment at line 09.
Sub proxy_SendingRequest(ByVal sender As Object,
ByVal e As SendingRequestEventArgs)

F. RequestHeaders.Add("Authorization",
"WRAP access_token=""123456789""")
End Sub

Answer: D

86

Explanation:

QUESTION NO: 2

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You create a Database Access Layer (DAL) that is database-independent.

The DAL includes the following code segment. (Line numbers are included for reference only.) 01 Shared Sub ExecuteDbCommand(connection As DbConnection)

02 If connection <> Nothing Then

03 Using connection

04 Try

05 connection.Open()

06 Dim command As DbCommand = connection.CreateCommand()

07 command.CommandText = "INSERT INTO Categories (CategoryName) VALUES ('Low Carb')"

08 command.ExecuteNonQuery()

09

10 Catch ex As Exception

11 Trace.WriteLine("Exception.Message: " + ex.Message)

12 End Try

13 End Using

14 End If

15 End Sub

You need to log information about any error that occurs during data access. You also need to log the data provider that accesses the database.

Which code segment should you insert at line 09?

87

A. Catch ex As OleDbException
Trace.WriteLine("ExceptionType: " + ex.Source)
Trace.WriteLine("Message: " + ex.Message)

B. Catch ex As OleDbException
Trace.WriteLine("ExceptionType: " + ex.InnerException.Source)
Trace.WriteLine("Message: " + ex.InnerException.Message)

C. Catch ex As DbException
Trace.WriteLine("ExceptionType: " + ex.Source)
Trace.WriteLine("Message: " + ex.Message)

D. Catch ex As DbException
Trace.WriteLine("ExceptionType: " + ex.InnerException.Source)
Trace.WriteLine("Message: " + ex.InnerException.Message)

Answer: C
Explanation: