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
how to retrieve property settings from xml .config file.
Is session stored in browser?
Difference between web user control and web custom control?
Describe how ASP.NET maintains process isolation for each Web application?
Why mvc is better than asp.net? : Asp.Net MVC
Explain difference between dataset and recordset?
What is viewstate parameter?
What does postback mean?
What is the difference between custom controls and user controls?
What is a windows service?
If you want to write your own dot net language, what steps you will you take care?
Define the term Web Garden?
What is the function used for removing an event listener?
What is asp.net web application?
What is skin in asp.net?