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
What is a session government?
To wrap up a call to a Web service the standard used is..?
What is the biggest disadvantage of “Other Return Types” in Web API?
How to find last error which occurred?
How do you declare static variable?
What are the layouts of ASP.NET Pages?
How can u deifne the benefits and limitation of using Viewstate for state management?
Why we go for mvc instead of asp.net? : Asp.Net MVC
Define managed code and managed data in .net?
Explain the main function of razor in asp.net? : asp.net mvc
Explain the difference between or and orelse?
How to implement role based security in asp.net mvc? : Asp.Net MVC
Explain the concept of event bubbling in ASP.NET?
What is the difference between system.stringbuilder and system.string
What is a web api? Which protocol is used in a web api?