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?

Answers were Sorted based on User's Feedback



Execute nonquery returns no. of afected rows.So if my stored procedure hav lot of select stmnt, de..

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

Execute nonquery returns no. of afected rows.So if my stored procedure hav lot of select stmnt, de..

Answer / suresh reddy

returns -1, since you can't find the how many rows effected because of your stored procedure.

Is This Answer Correct ?    4 Yes 0 No

Execute nonquery returns no. of afected rows.So if my stored procedure hav lot of select stmnt, de..

Answer / suraj

I don'nt have the right ans but i think the question was if
i have lot of delete stmnt, insert stmnt and update
statement...then what does execute nonquery returns in this
case? as for select we use execute reader...

Is This Answer Correct ?    0 Yes 0 No

Execute nonquery returns no. of afected rows.So if my stored procedure hav lot of select stmnt, de..

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

Execute nonquery returns no. of afected rows.So if my stored procedure hav lot of select stmnt, de..

Answer / sireesha

ExecuteNonQuery() returns one one value. the return type of
ExecuteNonQuery is integer. It returns the value that are
effected by the executeNonQuery() statement.

Is This Answer Correct ?    1 Yes 1 No

Execute nonquery returns no. of afected rows.So if my stored procedure hav lot of select stmnt, de..

Answer / pankaj shinde

Total number of rows effected.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More ADO.NET Interview Questions

What provider ado.net use by default? Explain the role of data provider in ado.net?

0 Answers  


How to find the count of records in a dataset?

6 Answers  


Which ado.net object is very fast in getting data from the database?

0 Answers  


can we change the data in dataset? if yes what is the process?

1 Answers   Artech,


What is ado.net and its architecture?

0 Answers  






Explain how to bind the controls(best practice) comboboxes to the data in the dataset?

0 Answers  


How do u implement locking concept for dataset?

2 Answers   ABC,


Does sqlclient and oledb class share the same functionality?

0 Answers  


What are all features of ADO.Net?

0 Answers  


What are the benefits of using ado.net?

0 Answers  


What is bubbled event?

0 Answers  


Differnces between oracle 9i and sql server?

2 Answers   College School Exams Tests, Microsoft,


Categories