Which ObjectContext method should you call after changes are made to the entities?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET Entity
Framework to model your entities. You use ADO.NET selftracking entities. You need to ensure that
the change-tracking information for the selttracking entities can be used to update the database.
Which ObjectContext method should you call after changes are made to the entities?
Which two XML element types should you use?
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 use Entity SQL of the ADO .NET Entity
Framework to retrieve data from the database. You need to define a custom function in the
conceptual model. You also need to ensure that the function calculates a value based on properties
of the object. Which two XML element types should you use? (Each correct answer presents part of
the solution Choose two.)
You need to ensure that all Contractors are bound to the Contractor class
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Sever 2008 database. The database includes a table that
contains information about all the employees. The database table has a field named EmployeeType
that identifies whether an employee is a Contractor or a Permanent employee. You declare the
employee entity base type. Yo create a new Association entity named Contractor that inherits the
Employee base type. You need to ensure that all Contractors are bound to the Contractor class.
What should you do?
Which method should you call before persisting changes?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application.
Theapplication uses the ADO.NET Entity Framework to model persistence-ignorant entities. The
applicationoperates in a disconnected mode. You need to ensure that changes made to local entities
while the application is in the disconnected mode are correctly persisted. Which method should you
call before persisting changes?
Which code segment should you insert at line 11?
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 write the following code segment that
executes two commands against the database within a transaction. (Line numbers are included for
reference only.)
01 using (SqlConnection connection = new SqlConnection(cnnStr)) {
02 connection.Open();
03 SqlTransaction sqlTran = connection.BeginTransaction();
04 SqlCommand command = connection.CreateCommand();
05 command.Transaction = sqlTran;
06 try {
07 command.CommandText = “INSERT INTO Production.ScrapReason(Name) VALUES(‘Wrong
size’)”;
08 command.ExecuteNonQuery();
09 command.CommandText = “INSERT INTO Production.ScrapReason(Name) VALUES(‘Wrong
color’)”;
10 command.ExecuteNonQuery();
11
12 }
You need to log error information if the transaction fails to commit or roll back. Which code segment
should you insert at line 11?
Which cryptograpny provider should you use?
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 stores encrypted credit card
numbers in the database. You need to ensure that credit card numbers can be extracted from the
database. Which cryptograpny provider should you use?
Which code segment should you insert at line 04?
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 following object
query to load a product from the database. (Line numbers are included for reference only.)
01using (AdventureWorksEntities advWorksContext = new AdventureWorksEntities())
02{
03ObjectQuery<Product> productQuery = advWorksContext.Product.Where(“it.ProductID = 900”);
04
05 }
You need to log the command that the query executes against the data source.
Which code segment should you insert at line 04?
Which line of code should you use?
You develop a Microsoft .NET Framework 4 application that uses the Entity Framework to store
entities in a Microsoft SQLServer2008 database. While the application is disconnected from the
database, entities that are added or modified are serialized to a local file. The next time the
application connects to the database, it retrieves a Customer entity from the database by using an
object context named context and stores the entity in a variable named remoteCustomer. The
application then deserializes 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 are persisted in the
database when the ObjectContext.SaveChanges() method is called. Which line of code should you
use?
You need to ensure that when you delete a customer record, the corresponding order records are deleted…
You use Microsoft Visual Studio 2010 and the Microsoft NET Framework 4 to create an application
The application connects to a Microsoft SQL Sewer database The application uses DataContexts to
query the database You define a foreign key between me customers and orders tables in the
database You need to ensure that when you delete a customer record, the corresponding order
records are deleted You want to achieve this goal by using the minimum amount of development
effort. What should you do?
You need to ensure that the application can detect all conflicts that occur between the offline customer infor
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 DataContexts to query
the database. The application meets the following requirements:
• Stores customer data offline.
• Allows users to update customer records while they are disconnected from the server.
• Enables offline changes to be submitted back to the SQL Server by using the DataContext
object.
You need to ensure that the application can detect all conflicts that occur between the offline
customer information submitted to the SQL Server and the server version. You also need to ensure
that you can roll back local changes. What should you do?