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
Which method do you use to kill explicitly a users session?
What is the purpose of using MVC programming pattern in ASP.NET?
How you can add an event handler?
What is state management techniques in asp.net?
Define view state.
What is the difference between typeof() vs gettype()?
Explain about secure socket layer?
In which event of the page viewstate is available?
What is the use of placeholder control? Can we see it at runtime?
How to disable validator control by client side JavaScript?
What is asp.net mvc? : asp.net mvc
What is synchronous and Asynchronous post back ?
Explain the concept of event bubbling in ASP.NET?
What is http session state?
What are the new login controls in asp.net 2.0?