What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.
Answer Posted / surya narayana panda
ExecuteReader-It is readonly forward only.It executes the
command and return the reader objectl.It executes only
select command.
ExecuteNonQuery-It executes command and return's no
value.It returns only how many row effected.It returns
value when the commandType is stroedProcedure with output
parameter.
ExecuteScalar-It executes the command and return a single
value.That is 1st column and 1st row.
| Is This Answer Correct ? | 24 Yes | 2 No |
Post New Answer View All Answers
They mostly asked difference between versions of technologies
Explain the asp.net mvc request life cycle? : asp.net mvc
What is the difference between an htmlinputcheckbox control and an htmlinputradiobutton control?
What parameters can you pass in the url of the api?
Difference between web user control and web custom control?
What is a nested masterpage in asp.net 2.0? Can there be a master page inside a masterpage?
What are the benefits of view state?
What are the two Layouts supported by a Web form in ASP.NET?
What is windows active directory authentication?
Where code pages are used?
What are the server control tags in asp.net.?
What is intrinsic objects in asp.net?
How to implement role based security in asp.net mvc? : Asp.Net MVC
How would you enable impersonation in the web.config file?
How many types of cookies are there in asp.net?