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
What is openquery?
What are the data providers in ADO.NET framework?
List the 4 common ado.net namespaces?
Which database is the ado.net?
What is difference between connected and disconnected architecture in ado.net?
What is csdl entity framework?
What is ado asp?
What are the Data providers in ADO.Net?
Define atomicity?
What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
What is execute scalar in ado.net?
Why edit is not possible in repeater?
What is Data Provider?
What is disconnected data?
Which is faster dataset or datareader?