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
How could you modify xaml content from javascript?
What is the base class from which web forms are inherited?
How does ASP.NET framework maps client side events to Server side events.?
What is asp.net mvc? : asp.net mvc
Why is this service branded with windows livetm?
Explain the advantages of asp.net.
Define the term Web Garden?
How will create assesblies at run time?
What is the web.config file in asp?
Explain significance of routing? : asp.net mvc
What is asynchronous call?
What are web server controls in asp.net?
What is the use of session state and application state and difference between them?
What do you mean by role-based security?
What are type/key pairs in client script registration? Can there be 2 scripts with the same type/key pair name?