Getting the return value as -1 in cmd.ExecuteNonQuerry()

Posted by Gokul under ASP.NET on 9/21/2011 | Points: 10 | Views : 1006 | Status : [Member] | Replies : 2
Dear Friends,
I am getting the return value as -1 in Cmd.ExecuteNonQuerry(). But i have value in the table. Can any one help me to resolve this issue?


Regards,
Gokul.

Thanks and Regards,
GokulNath Nithy.



Responses

Posted by: PandianS on: 9/21/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Gukul

- Are you using simple SELECT statements (or) Stored procedures ?
- If you using Stored Procedures then, are u using SET NOCOUNT ON inside the stored procedure ?

If so, the method(ExecuteNonQuerry()) will return as -1 instead of actual no. of rows affected...

Kindly have a look!

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 9/21/2011 [Member] Bronze | Points: 25

Up
0
Down
Please paste the code here so that we can see it.....

Regards
Akiii

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response