Which method of the EntityCommand type should you use?

You are developing an ASP.NET MVC application. The application has a page that searches
for and displays an image stored in a database. Members of the EntityClient namespace are
used to access an ADO.NET Entity Framework data model. Images and associated
metadata are stored in a database table.
You need to run a query that returns only the image while minimizing the amount of data that
is transmitted.
Which method of the EntityCommand type should you use?

You are developing an ASP.NET MVC application. The application has a page that searches
for and displays an image stored in a database. Members of the EntityClient namespace are
used to access an ADO.NET Entity Framework data model. Images and associated
metadata are stored in a database table.
You need to run a query that returns only the image while minimizing the amount of data that
is transmitted.
Which method of the EntityCommand type should you use?

A.
ExecuteScalar

B.
ExecuteDbDataReader

C.
ExecuteReader

D.
ExecuteNonQuery



Leave a Reply 5

Your email address will not be published. Required fields are marked *


dotNetter

dotNetter

Should be A.

ExecuteNonQuery() does not return data at all: only the number of rows affected by an insert, update, or delete

MN

MN

A
ExecuteScalar

Executes the command, and returns the first column of the first row in the result set. Additional columns or rows are ignored.

Marianor

Marianor

It should be C, it says images and associated metadata

pnik

pnik

A. ExecuteScalar