what is Execute NOn Query?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / pavan
This function is used to execute the DMLcommands. It return
int value resulting number of rows get affected.
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / parag
Execute non Query is used to execute more than one command
at the time like in DML command.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / suman zalodiya
ExecuteNonQuery() is used when you run rhe query that
doesn't return anything.For example insert,update,delete
etc.
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / kamalakannan
update Request.QueryString aslo Execute non query
| Is This Answer Correct ? | 5 Yes | 9 No |
Answer / anna
it returns the no. of queries executed successfully
| Is This Answer Correct ? | 40 Yes | 85 No |
What are dcl commands?
What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
Why is stored procedure used in ado.net?
What is aggregate root?
List all the steps in order, to access a database through ado.net?
What are the objects of ado.net?
Explain the difference in an abstract class and an interface?
Call a stored procedure from ado.net and pass parameter to it ?
7 Answers Keane India Ltd, TCS,
What are the advantages and disadvantages of using datalist?
what is meant by connection pooling and event pumbling in ado.net
Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?
Can we connect two dataadapters to same data source using single connection at same time?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)