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
What is a web farm?
What is difference between session and application in asp net?
Do you know using sql cache invalidation?
How do I create a web form?
What is is post back property in asp net?
To add a hyperlink column to the DataGrid which tag is used ?
What is gridview in asp.net?
what is AutoEventWireUp and what is the use of This property explain in details?
What is rending process in ASP.NET?
How you will manage the state of ASP.NET controls?
What is application variable?
Is a dll file an executable?
What are the modes of updation in an updatepanel?
Explain Optimization technique description?
Describe the difference between inline and code behind - which is best in?