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
What is dao and ado?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
List the 4 common ado.net namespaces?
Why is ADO.NET serialization slower than ADO ?
What is basic use of data view?
What is serialization and de-serialization in .net?
What is the difference in record set and dataset?
Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.
What is a sqldataadapter?
How can we add/remove row's in "datatable" object of "dataset"?
What is ole word?
Explain how to find the given query is optimised one or not?
Explain ODP.net
Explain the different row versions available in table?
Which is better entity framework or ado.net?