What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.
Answer Posted / jerry joseph
ExecuteReader - This method returns a DataReader which is
filled with the data that is retrieved using the command
object.
ExecuteNonQuery - This method returns no data at all. It is
used majorly with Inserts and Updates of tables.
ExecuteScalar - Returns only one value after execution of
the query. It returns the first field in the first row.
This would be excellent for receiving a count of records
(Select Count(*)) in an sql statement, or for any query
where only one specific field in one column is required.
| Is This Answer Correct ? | 35 Yes | 9 No |
Post New Answer View All Answers
What is difference between session and cookies in asp net?
In which event are the controls fully loaded?
What is directive in asp net?
Define machine.config in .net?
How many types cache in asp net?
What are the different properties of server control that exists?
What are Master Pages in ASP.NET? or What is a Master Page?
Explain what is an abstract class?
What is http post action?
What is a multilingual website?
Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net
What is latest version of asp.net mvc? : Asp.Net MVC
What asp.net control can embed xaml into asp.net pages?
What is localhost in asp.net?
Which protocol is used to call a web service?