Execute nonquery returns no. of afected rows.So if my stored
procedure hav lot of select stmnt, delete stmnt, insert
stmnt..then what does execute nonquery returns in this case?
Answer Posted / jaya tiwari
Execute non query executes a query that is associated with
sqlCommand object . sqlCommand object having a property
sqlCommandobj.CommandText in which we pass the query. so
ExecuteNonQuery will return the no of rows affected by that
command whose sqlCommand obj invokes this method .
and it can't be use for select as its return type is int
that is no of rows affected in execution of that query
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Explain how do you connect to sql server database without using sqlclient?
Which keyword is used to accept variable number of parameters?
How is entity framework different from ado.net?
What are different layers of ADO.Net?
Does dapper use ado.net?
Explain the difference in an abstract class and an interface?
differance between ADO vs ADO.Net?
What is connection pooling and what is the maximum pool size in ado.net connection string?
What is the DataTableCollection?
What are the core objects of ADO.NET?
What is difference between Dataview and Datatable?
What are dataproviders?
Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
How can we save all data from dataset?
What is the role of data provider in ado.net?