which one is faster execute reader, scalar, execute non
query ?
Answer Posted / satish v itagi
ExecuteNonQuery is used to inserts, updates, deletes.
ExecuteScaler is used to return values at a stretch; and
can do data modifications too.
ExecuteReader is forward only reading of row by row.
The number of readers that can be open at a time has
limitation (255)
Execute Scaler has no such restriction. You can use
sqlparameters (output) to get more than one field value,
you can use multiple queries to get more than one result.
Because of less overheads, ExecuteReader has a slight
performance advantage but has limitations.
Do not forget to close Readers!
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Is it true that a Web service must be written in .NET or not?
What is ispostback method in asp.net? Why do we use that?
Explain the difference between globalization and localization techniques
Define globalization and localization.
Is oauth for authentication or authorization?
Differentiate strong typing and weak typing
How does asp.net work?
What is the importance of Global.asax in ASP.NET?
What does uri mean?
What is the difference between Hash table and Array list?
What is route in web api?
For which does this Codebehind="MyCode.aspx.cs" is relevent to ?
What is the latest version of asp.net?
Define managed code and managed data in .net?
What is the difference between union and join?