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 / sandyni

Execute nonquery effects only for DML like Update delete
and insert statements only,

for select statement we have to choose ExecuteScalar or
ExecuteReader methods. these methods can return datareader
and gives the result for your query.

Is This Answer Correct ?    18 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which database is the ado.net?

758


What does ado stand for?

717


If we are not returning any records from the database, which method is to be used?

1035


What is ado.net and its features?

760


Define ado.net?

823


What is DataRowCollection?

857


what is the difference betwen typed dataset and untyped dataset?in general which dataset can we use in programming?

776


What are the Data providers in ADO.Net?

776


What is row state?

734


How do you update a dataset in ado.net and how do you update database through dataset?

721


What is ado net stands for?

738


What are advantages of microsoft-provided data provider classes in ado.net?

789


Which control of the BindingNavigator returns the current position within the data source?

948


Which is faster datareader or dataadapter?

768


What is different between sqlcommand object and command behavior object?

769