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 generate a single aggregate?
What are different layers of ADO.Net?
What is ole access?
What is disconnected scenario in entity framework?
How to identify the controls which can be used for binding data?
What is the full form of ado.net?
Explain the namespaces in which .net has the data functionality class.
What is the role of clr?
Define isolation?
How to check if the Dataset has records ?
What are the advantages using ado.net?
Explain the difference between sqlcommand object and command behavior object?
What is ado oledb and odbc?
What is namespace in ado.net?
Explain sqlconnection object?