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
Explain the difference between ado and ado.net?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
Which object of ado contains datarow datacolumn collection?
What are the steps you will take to improve performance? Will you use dataset or datareader?
What are the advantages using ado.net?
What are the Data providers in ADO.Net?
What is adodb dll?
how we can fire event in databound coulm in datagfrid withot using button?
differance between ADO vs ADO.Net?
Define Execute Scalar?
What you mean by filtering of data?
What are all the different methods under sqlcommand?
What is row state?
Explain the difference between data reader and data adapter?
What do you know about ado.net's methods?