originale Fragen70-516 Microsoft it-pruefungen

originale Fragen70-516 Microsoft it-pruefungen

Alle unsere Online-Training Werkzeuge sind mit den wechselnden Prüfungszielen verfügbar, so dass Sie sicher sein, immer für Ihre Business Solutions mit den neuesten und origninalsten Praxisprüfungen vorzubereiten und unsere Business Solutions kann aktualisiert werden und Sie bekommen Werkzeuge zu günstigen Preisen für Ihren eigenen Komfort.

70-516 TS: Accessing Data with Microsoft .NET Framework 4 Vorbei an den Praxisprüfungen ist es keineswegs schon schneller und einfacher, jetzt mit spezifischen Fragen und Antworten, mit aus den chaotisch Business Solutions, die sein oft falsch kann. grenzenlose Prüfungen sind nicht nur die weniger kostspielige Methode, sondern um mit sich Rückgriff auf Praxisprüfung passieren.

originale Fragen70-516 Microsoft it-pruefungen

QUESTION 1
You use Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
The application defines the following Entity SQL (ESQL) query, which must be executed against the mode.

string prodQuery = “select value p from Products as p where p.ProductCategory.Name = @p0″;

You need to execute the query. Which code segment should you use?

A. var prods = ctx.CreateQuery(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();
B. var prods = ctx.ExecuteStoreCommand(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();
C. var prods = ctx.ExecuteFunction(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();
D. var prods = ctx.ExecuteStoreQuery(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();

Answer: A

Explanation/Reference:
CreateQuery – Creates an ObjectQuery in the current object context by using the specified query string.
ExecuteStoreCommand – Executes an arbitrary command directly against the data source using the existing connection.
ExecuteFunction(String, ObjectParameter[]) – Executes a stored procedure or function that is defined in the data source and
expressed in the conceptual model; discards any results returned from the function; and returns the number of rows affected by the execution.
ExecuteStoreQuery(String, Object[]) – Executes a query directly against the data source that returns a sequence of typed results.

ObjectContext.CreateQueryMethod
(http://msdn.microsoft.com/en-us/library/bb339670.aspx)

QUESTION 2
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database.
The application uses nested transaction scopes. An inner transaction scope contains code that inserts records into the database.
You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls back.

What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this goal?
(Each correct answer presents a complete solution. Choose two.)

A. TransactionScope(TransactionScopeOption.Required)
B. TransactionScope()
C. TransactionScope(TransactionScopeOption.RequiresNew)
D. TransactionScope(TransactionScopeOption.Suppress)

Answer: CD

Explanation/Reference:
Required – A transaction is required by the scope. It uses an ambient transaction if one already exists.
Otherwise, it creates a new transaction before entering the scope. This is the default value.
RequiresNew – A new transaction is always created for the scope.
Suppress – The ambient transaction context is suppressed when creating the scope.
All operations within the scope are done without an ambient transaction context.

TransactionScopeOption Numeration
(http://msdn.microsoft.com/en-us/library/system.transactions.transactionscopeoption.aspx)

QUESTION 3
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
Entity types in the model are generated by the Entity Data Model generator tool (EdmGen.exe).
You write the following code. (Line numbers are included for reference only.)

01 MemoryStream stream = new MemoryStream();
02 var query = context.Contacts.Include(“SalesOrderHeaders.SalesOrderDetails”);
03 var contact = query.Where(“it.LastName = @lastname”, new ObjectParameter(“lastname”, lastName)).First();
04 ….

You need to serialize the contact and all of its related objects to the MemoryStream so that the contact can be deserialized back into the model.
Which code segment should you insert at line 04?

A. var formatter = new XmlSerializer(typeof(Contact), new Type[]
{

typeof(SalesOrderHeader),

typeof(SalesOrderDetail)
});
formatter.Serialize(stream, contact);

B. var formatter = new XmlSerializer(typeof(Contact));
formatter.Serialize(stream, contact);

C. var formatter = new BinaryFormatter();
formatter.Serialize(stream, contact);

D. var formatter = new SoapFormatter();
formatter.Serialize(stream, contact);

Answer: A

originale Fragen70-516 Microsoft it-pruefungen