The return type for ExecuteNonQuery() is ______________

 Posted by deccansoft on 8/5/2010 | Category: C# Interview questions | Views: 8744
Select from following answers:
  1. void
  2. int
  3. String
  4. char

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Akiii on: 6/9/2012
excellent....



Regards
Akiii
Posted by: Vasanthmvp on: 8/19/2012
Hi, in the below link:

http://www.dotnetfunda.com/codes/code1078-difference-between-executenonquery-executescalar-and-executereader.aspx

they had mentioned that the return type of ExecuteNonQuery is int type, but as far as my knowledge action queries returns number of rows affected.

Could you please explain me the correct answer. (return type is void or int.)

Regards,
Posted by: Kanchan.Ms on: 2/19/2013
wrong answer.
ExecuteNonQuery Return type is INT32.
for more info see the link:http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executenonquery.aspx

Login to post response