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

What are the benefits of using ado.net?

719


What are the benefits of ADO.NET?

863


What are the advantages of oledb compared with other classes?

2569


Which is faster ado.net or linq?

770


Explain what are the steps to connect to a database?

736


How is it possible to get 2 tables of data at a time by using data reader?

700


What is a control toolbox?

705


What is ole db query?

756


What is datasource in ado.net?

827


If a table contains 20000 records. In a page at each time 100 records to be displayed.

704


Does sqlclient and oledb class share the same functionality?

723


What are the types of databinding?

736


Describe ado.net object model in detail.

758


What is ado connection?

704


What we do with the object of ado.net dataset after using it?

721