PrepAway - Latest Free Exam Questions & Answers

Which method should you call?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You manually create your own Context class named AdventureWorksDB that inherits from ObjectContext.
You need to use AdventureWorksDB to invoke a stored procedure that is defined in the data source.
Which method should you call?

PrepAway - Latest Free Exam Questions & Answers

A.
Translate

B.
ExecuteFunction

C.
ExecuteStoreQuery

D.
ExecuteStoreCommand

Explanation:
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.
ExecuteStoreCommand() Executes an arbitrary command directly against the data source using the existing connection.
ExecuteStoreQuery<TElement>(String, Object[]) Executes a query directly against the data source that returns a sequence of typed results.
Translate<TElement>(DbDataReader) Translates a DbDataReader that contains rows of entity data to objects of the requested entity type.

ObjectContext.ExecuteFunction Method
(http://msdn.microsoft.com/en-us/library/dd986915.aspx)


Leave a Reply