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 a uri query?
is there any third party tools are using in .net technologies? what are there ? give me the brief introduction?
How Session use Cookies in State Management?
Explain difference betn dataset and recordset?
What is viewstate in asp net with example?
Explain the difference between an exe and a dll?
What are the asp.net 2.0 features?
Explain security types in asp.net?
What are the advantages of Web API?
What is postback and autopostback in asp.net?
Describe paging in asp.net?
What is the difference between ASP.NET Webforms and ASP.NET MVC?
Explain how can we inherit a static variable?
Can we set master page as a start page?
What is _dopostback in asp net?