What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.
Answer Posted / jerry joseph
ExecuteReader - This method returns a DataReader which is
filled with the data that is retrieved using the command
object.
ExecuteNonQuery - This method returns no data at all. It is
used majorly with Inserts and Updates of tables.
ExecuteScalar - Returns only one value after execution of
the query. It returns the first field in the first row.
This would be excellent for receiving a count of records
(Select Count(*)) in an sql statement, or for any query
where only one specific field in one column is required.
| Is This Answer Correct ? | 35 Yes | 9 No |
Post New Answer View All Answers
How to fetch a data from one table to another table in asp.net ?
Where are session variables stored?
Explain server control extensibility with reference to asp.net 2.0 ?
Explain client-side scripting?
What is the difference between sealed vs static class?
Explain the namespace classes used in asp.net mvc? : asp.net mvc
What are html helpers in asp.net?
Can you explain architecture of your project ?
What is the use of asp.net web api?
Explain the overview of asp.net?
What is .net remoting?
What are session and cookies?
What is _dopostback in asp net?
What are the benefits of view state?
If we remove web.config or machine.config from the application then, is this application will works?