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 query string with example?
Do you know using sql cache invalidation?
How can you display all validation messages in one control?
What is syntax code to send email from an asp.net application?
What is a page life cycle?
What's the use of response.output.write()?
What r the asp.net list controls and difference between them?
Which validator control you use if you need to make sure the values in two different controls matched?
If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
What is validation in asp.net?
What is meant by server side scripting?
Is viewstate secure?
What is the use of execute non query in asp.net?
In order to get assembly info which namespace we should import?
Which object wraps the state or data of a user?