Posts Tagged ‘70-680 Torrent’
MCTS Windows 7 Configuration, Microsoft 70-680 Training
January 17th, 2012 Comments OffQUESTION NO: 1
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Microsoft ASP.NET application. You want to connect the application to a Microsoft SQL Server Express 2008 database named MyDatabase. The primary database file is named MyDatabase.mdf and it is stored in the App_Data folder. MCTS Windows 7 Configuration
You need to define the connection string.
Which connection string should you add to the Web.config file?
A. Data Source=localhost; Initial Catalog=MyDataBase; Integrated Security=SSPI; User Instance=True
B. Data Source=.\SQLEXPRESS; Initial Catalog=MyDataBase; Integrated Security=True; User Instance=True
C. Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\MyDatabase.mdf; Integrated Security=True; User Instance=True
D. Data Source=SQLEXPRESS; AttachDbFilename=|DataDirectory|\App_Data\MyDatabase.mdf; Integrated Security=SSPI; User Instance=True
Answer: C
Explanation:
QUESTION NO: 2
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 the ADO.NET Entity Framework to model entities.
The database includes objects based on the exhibit. (Click the Exhibit button.)

The application includes the following code segment. (Line numbers are included for reference
only.)
01 Using advWorksContext As New AdventureWorksEntities()
02
03 End Using
You need to retrieve a list of all Products from todays sales orders for a specified customer.
You also need to ensure that the application uses the minimum amount of memory when retrieving the list.
Which code segment should you insert at line 02?
A. Dim customer As Contact = context.Contact.Where("it.ContactID =
@customerId", New ObjectParameter("customerId", customerId)).First() customer.SalesOrderHeader.Load()
For Each order As SalesOrderHeader In customer.SalesOrderHeader
order.SalesOrderDetail.Load()
If order.OrderDate.[Date] = DateTime.Today.[Date] Then
94
For Each item As SalesOrderDetail In order.SalesOrderDetail
Console.WriteLine([String].Format("Product: 0 ", item.ProductID))
Next
End If
Next
B. Dim customer As Contact = context.Contact.Where("it.ContactID =
@customerId", New ObjectParameter("customerId", customerId)).First() customer.SalesOrderHeader.Load()
For Each order As SalesOrderHeader In customer.SalesOrderHeader
If order.OrderDate = DateTime.Today Then
order.SalesOrderDetail.Load()
For Each item As SalesOrderDetail In order.SalesOrderDetail
Console.WriteLine([String].Format("Product: 0 ", item.ProductID))
Next
End If
Next
C. Dim customer As Contact = (From contact In context.Contact.Include("SalesOrderHeader") _ Select contact).FirstOrDefault()
For Each order As SalesOrderHeader In customer.SalesOrderHeader
order.SalesOrderDetail.Load()
If order.OrderDate = DateTime.Today Then
For Each item As SalesOrderDetail In order.SalesOrderDetail
Console.WriteLine([String].Format("Product: 0 ", item.ProductID))
Next
End If
Next
D. Dim customer As Contact = (From contact In
context.Contact.Include("SalesOrderHeader.SalesOrderDetail") _
Select contact).FirstOrDefault()
For Each order As SalesOrderHeader In customer.SalesOrderHeader
If order.OrderDate.[Date] = DateTime.Today.[Date] Then
For Each item As SalesOrderDetail In order.SalesOrderDetail
Console.WriteLine([String].Format("Product: 0 ", item.ProductID))
Next
End If
Next
Answer: B
Explanation:







