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
When cookie will expire?
I am trying to implement sorting facility from client side code in GridView Control. So how can I fill up an Array inside client side code (using JavaScript), i want to assign my DataSet object declared and filled up on Server side(in code behind) to the array (on client side)
What is web router?
Explain the difference between singleton and single call?
What are strong names?
What are the main differences between asp and asp.net?
What is round trip in asp.net?
What is application session?
If we remove web.config or machine.config from the application then, is this application will works?
Explain difference between friend and protected friend?
In which event of page cycle is the viewstate available?
What is query string with example?
How to include silver light .xap page into asp.net web application and what is the purpose of using silverlight application?
What are triggers of an updatepanel?
What is the extension of master page in asp.net?