Posts Tagged ‘70 680 Test Questions’
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:
MCTS Windows 7 Configuration, 70 680 Test Questions
January 16th, 2012 Comments OffQUESTION NO: 1
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database by using SQL Server authentication.
The application contains the following connection string.
SERVER=DBSERVER-01; DATABASE=pubs; uid=sa; pwd=secret;
You need to ensure that the password value in the connection string property of a SqlConnection object does not exist after the Open method is called.
What should you add to the connection string?
A. Persist Security Info=True
B. Trusted_Connection=True
C. Persist Security Info=False
D. Trusted_Connection=False
Answer: C
Explanation:
QUESTION NO: 2
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the ADO.NET Entity Framework to model entities.
You write the following code segment. (Line numbers are included for reference only.)
01 Dim context As New AdventureWorksEntities("http://localhost:1234/AdventureWorks.svc") 02 03 Dim q As var = From c In context.Customers _
04 Where c.City ="London" _
05 Order By c.CompanyName _
06 Select c
92
You need to ensure that the application meets the following requirements:
- -
Compares the current values of unmodified properties with values returned from the data source Marks the property as modified when the properties are not the same MCTS Windows 7 Configuration
Which code segment should you insert at line 02?
A. context.MergeOption = MergeOption.AppendOnly
B. context.MergeOption = MergeOption.PreserveChanges
C. context.MergeOption = MergeOption.OverwriteChanges
D. context.MergeOption = MergeOption.NoTracking
Answer: B
Explanation:







