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

Which object is used to add relationship between two Datatables?

809


What does adodb stand for?

716


Why is it important to close an ado.net application?

779


How to work with disconnected data - the dataset and sqldataadapter?

759


Which method in OLEDBAdapter is used to populate dataset with records?

793


What is disconnected scenario in entity framework?

805


How to identify the controls which can be used for binding data?

772


How does ado.net work?

692


What is shadow copy?

776


How to find the given query is optimised one or not?

760


Do we use stored procedure in ADO.Net?

771


Explain how can we load multiple tables in to dataset?

718


What are the Features of a dataset

919


How to pass values into a datatable?

847


What is executenonquery ado.net?

737