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 can we check that some changes have been made to dataset since it was loaded?

741


What is meant by executenonquery?

718


What is sqldatareader?

679


What is maximum pool size in ado.net connection string?

729


What does adodb stand for?

699


What are the uses of Stored Procedure?

777


Which parameter of ConnectionString is used to specify the name of the database?

778


What is Data Provider?

799


Explain how do you connect to sql server database without using sqlclient?

706


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

740


What is Serialization in .NET? what are the types of Serialization?

772


What are the essential features of ado.net?

723


List all the steps in order, to access a database through ado.net?

816


What is ado.net object model?

714


What are three methods for displaying data in a syncfusion datagrid

823