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
Does web services support data reader like pom project?
In order to bind the data from a data source to the Repeater control what property is set and what method must you call in your code,?
What is event bubbling?
What are the types of validation in asp net?
Explain server control extensibility with reference to asp.net 2.0 ?
What is the default timeout for a cookie?
Explain http handlers? Where we can use the http handlers?
How do you deploy your asp.net application?
What is latest version of asp.net mvc? : Asp.Net MVC
How to you can limit Access to Web API to Specific HTTP Verb?
What are the session variables?
Can you explain architecture of your project ?
What are the advantages of using sql stored procedures instead of adhoc sql queries in an asp.net web application?
Why do I get error message "could not load type" whenever I browse to my asp.net web site?
Can we have multiple worker process in an ASP.NET application? If so then how it has been handled by application? And who handles it?