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


Please Help Members By Posting Answers For Below Questions

How to enable and disable connection pooling?

501


What is the difference between ado.net and oledb?

477


What two types of data providers does ADO.NET supply? What determines which one you should use?

531


What is data control techniques?

501


What is difference between executenonquery and executequery?

465






How to aggregating data across related tables?

545


What are typed and untyped dataset?

548


What is commandbuilder in ado.net?

520


What does executenonquery () method return?

494


What is full form of ado?

532


What are the difference between readonly vs. Const?

497


Why do we serialize data?

489


Explain the difference between an ado.net dataset and an ado recordset?

529


How to create dynamic gridview?

584


What is acid in ado.net?

524