What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.
Answer Posted / chitransu verma
ExecuteNonQuery-It executes the DML
commonds(insert,update,delete)and retuns the number of
affected rows.
ExecuteScaler-Lightweight version on executenonquery.
used besically for singalton queries.
It executes the sql statements or stored procedures and
returns a scalar value form first column and first row.
It is used to execute aggregate function like
Avg().Count(*),Max(),Min() etc.When compare to ExecuteReader
It uses Fewer System Resources.
ExecuteReader-It execute sql statement and return the
DataReader Object.
It is used to select records from the tables stored in
database.
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
8. Why do you want to work here?
Why session is more secure than cookies?
What are cookies in asp.net?
When you use Ajax controls in the ASP.NET application?
What is content place holder?
What types of data validation events are commonly seen in the client-side form validation?
What is the sequence in which ASP.NET events are processed?
What is considered a service provider?
Why we are using mvc instead of asp.net? : Asp.Net MVC
Just by seeing the signature of the bean how can you specify whether it is a stateful or stateless session bean?
How do you identify that the page is postback?
What does mean by a neutral culture?
What are client activated objects and server activated objects?
Why do we need master page in asp.net?
What is parse in asp.net?