What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.

Answer Posted / sudha

Executereader :-is used with read Method and it will read
the query and fill that in a dataset.we use it in
datareader.

Execute Scalar:-is used when you want a single output.It is
used with Return Value.

ExecuteNonQuery:-This Function is Used When you want to
update your query it does not perform any aoperation like:-
update,deletion,insert.It is used with Perform Action.

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which library is used by the testers and developers to develop automated tests and create testing tools?

538


Let's say I have an existing application written using vb6 and this application utilizes windows 2000 com+ transaction services. How would you approach migrating this application to.net?

503


What is the used of "ispostback" property?

563


Where session variables are stored?

541


What is the difference between session object and application object?

589






When should I use server transfer and response redirect?

508


Explain the difference between debug.write and trace.write? When should each be used?

554


What is ascx?

527


What is difference between inproc and outproc?

658


Explain Areas in MVC?

645


What is bound controls

583


In which event of page cycle is the viewstate available?

574


how to include timer or counting time to display next page in asp.net

1601


What is the difference between equals() and == in c#?

564


Define secured sockets layer.

535