what is Execute NOn Query?
Answer Posted / nandu
ExecuteNonQuery
Use: when we are talking about a single database record - in Update, Insert, Delete and Get by Id. In all these cases we can use input/output/input-output parameters. Please note that from the application architecture point of view it is also good practices when your Insert and Update stored procedure returns changed record exactly like Get By Id method does.
Conclusion
Always use ExecuteNonQuery except: when you have a set of records - use ExecuteReader and when you have a single output value that cannot be defined as a parameter - use ExecuteScalar. Hope this helped to clarify something.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to create data relations?
Does dapper use ado.net?
What are the different execute methods of Ado.Net?
Where is adodb dll located?
Which ado.net object is very fast in getting data from the database?
What are the main differences between classic ado and ado.net?
What two types of data providers does ADO.NET supply? What determines which one you should use?
Which is better ole db or odbc?
What is linq and entity framework?
What is connected architecture in ado.net?
What is data view and variable view?
Which keyword is used to accept variable number of parameters?
How can you add or remove rows from the datatable object of dataset?
What is difference between connected and disconnected architecture in ado.net?
How can we check that some changes have been made to dataset since it was loaded?