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

What is the role of data provider in ado.net?

552


What is full form of ado?

539


What is the advantage of ado.net?

549


What are the parameters that control most of connection pooling behaviours?

574


How to check if a datareader is closed or opened? IsClosed()

586






Describe datareader object of ado.net with example.

511


What are the features of ado.net?

505


What is microsoft ado.net?

578


What is bubbled event can you please explain?

529


What are the key features of ado.net?

668


Why ca not we use multiple inheritance and garbage collector paralelly in .net?

555


What provider ado.net use by default? Explain the role of data provider in ado.net?

528


What is basic use of data view?

512


What are the Features of a dataset

666


Explain how to create dynamic gridview?

521