Home All Groups Group Topic Archive Search About

ExecuteNonQuery returning -1

Author
29 Mar 2006 1:03 AM
Winista
I have a stored procedure that adds a new record in the database and have
another SP that updates a record. I used to call ExecuteNonQuery method on
command object and it used to return 1 if method executed sucessfully. This
was all fine and dandy in .Net1.1

Now in .Net 2.0 I use the same code and ExecureNonQuery returns -1 for both
command objects.

Any thing changed between 1.1 and 2.0 that I need to be aware of? This is
causing a lot of code to break.

Author
29 Mar 2006 1:53 PM
Marina Levit [MVP]
Are you sure no one added 'set nocount on' in the stored procedures, or
something like that?

I think if you have a very simple reproduceable case with the stored
procedure and .NET code, that would help.

Show quote
"Winista" <naveenko***@hotmail.com> wrote in message
news:OVcyeysUGHA.736@TK2MSFTNGP12.phx.gbl...
>I have a stored procedure that adds a new record in the database and have
>another SP that updates a record. I used to call ExecuteNonQuery method on
>command object and it used to return 1 if method executed sucessfully. This
>was all fine and dandy in .Net1.1
>
> Now in .Net 2.0 I use the same code and ExecureNonQuery returns -1 for
> both command objects.
>
> Any thing changed between 1.1 and 2.0 that I need to be aware of? This is
> causing a lot of code to break.
>

AddThis Social Bookmark Button