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

Can datareader hold data from multiple tables?

679


how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?

585


How to generate a single aggregate?

544


Define atomicity?

583


What is the provider being used to access oracle database?

505






What is full form of ado?

539


What is ado rdo dao in visual basic?

669


What Is Difference Between Ado And Ado.net?

564


What is the difference in an abstract class and an interface?

520


What are the steps to connect to a database?

550


What is ado in agriculture?

515


What is the use of ADO.NET and XML web services?

596


What is ambient transaction?

508


What is the difference between executenonquery () and executescalar ()?

498


What is difference between dataset and datatable?

513