BlankI have found a major problem with the OleDb portion of ADO.NET. If you
are using it to call a stored procedure and the procedure has an internal
error of some type, the sp will fail, but the OleDbCommand object will not
throw any type of error.
For example, I have a proc that does an insert and I pass in a value for one
of the parameters that will cause a foreign key violation. The call the
proc will complete but nothing will be inserted. I can create that same
insert statement and call it with an OleDbCommand object and will get the
error.
Other than a return value, does anyone know how to get a call to an SP to
throw an error when it fails??????

--
John Mark Howell

Re: SP fails, but OleDbCommand does not throw error! by Robert

Robert
Tue Sep 07 10:28:45 CDT 2004

We need more information than that in order to provide assistance. Mainly,
what database are you using, and what ODBC provider? I doubt it's a problem
with ADO.NET, only because that's something important enough to have been
caught and fixed by now, I'm sure. Also note that it's up to the ODBC
provider to send notification of an error. Make sure you're using the latest
version.

I don't normally use ODBC Providers, so this may be by design and someone
may have a better answer for you, however it would be very helpful if you
could provide more information regarding your specific problem. What
database are you using? What is the code you are using to execute your
command? What version ODBC provider?

--ROBERT

"John Mark Howell" <jmarkhowell@hotmail.com> wrote in message
news:uZ%23EMpOlEHA.2892@tk2msftngp13.phx.gbl...
> BlankI have found a major problem with the OleDb portion of ADO.NET. If
you
> are using it to call a stored procedure and the procedure has an internal
> error of some type, the sp will fail, but the OleDbCommand object will not
> throw any type of error.
> For example, I have a proc that does an insert and I pass in a value for
one
> of the parameters that will cause a foreign key violation. The call the
> proc will complete but nothing will be inserted. I can create that same
> insert statement and call it with an OleDbCommand object and will get the
> error.
> Other than a return value, does anyone know how to get a call to an SP to
> throw an error when it fails??????
>
> --
> John Mark Howell
>
>



Re: SP fails, but OleDbCommand does not throw error! by Robert

Robert
Tue Sep 07 11:13:26 CDT 2004

Correction: OleDB Providers. :) It's one of those mornings.

--ROBERT

"Robert Bouillon" <djwhizzard@hotmail.com> wrote in message
news:OhdMrMPlEHA.3340@TK2MSFTNGP14.phx.gbl...
> We need more information than that in order to provide assistance. Mainly,
> what database are you using, and what ODBC provider? I doubt it's a
problem
> with ADO.NET, only because that's something important enough to have been
> caught and fixed by now, I'm sure. Also note that it's up to the ODBC
> provider to send notification of an error. Make sure you're using the
latest
> version.
>
> I don't normally use ODBC Providers, so this may be by design and someone
> may have a better answer for you, however it would be very helpful if you
> could provide more information regarding your specific problem. What
> database are you using? What is the code you are using to execute your
> command? What version ODBC provider?
>
> --ROBERT
>
> "John Mark Howell" <jmarkhowell@hotmail.com> wrote in message
> news:uZ%23EMpOlEHA.2892@tk2msftngp13.phx.gbl...
> > BlankI have found a major problem with the OleDb portion of ADO.NET. If
> you
> > are using it to call a stored procedure and the procedure has an
internal
> > error of some type, the sp will fail, but the OleDbCommand object will
not
> > throw any type of error.
> > For example, I have a proc that does an insert and I pass in a value for
> one
> > of the parameters that will cause a foreign key violation. The call the
> > proc will complete but nothing will be inserted. I can create that same
> > insert statement and call it with an OleDbCommand object and will get
the
> > error.
> > Other than a return value, does anyone know how to get a call to an SP
to
> > throw an error when it fails??????
> >
> > --
> > John Mark Howell
> >
> >
>
>



Re: SP fails, but OleDbCommand does not throw error! by Edward

Edward
Tue Sep 07 21:52:46 CDT 2004

On 2004-09-07 09:52:27 -0500, "John Mark Howell"
<jmarkhowell@hotmail.com> said:

> BlankI have found a major problem with the OleDb portion of ADO.NET. If you
> are using it to call a stored procedure and the procedure has an internal
> error of some type, the sp will fail, but the OleDbCommand object will not
> throw any type of error.
> For example, I have a proc that does an insert and I pass in a value for one
> of the parameters that will cause a foreign key violation. The call the
> proc will complete but nothing will be inserted. I can create that same
> insert statement and call it with an OleDbCommand object and will get the
> error.
> Other than a return value, does anyone know how to get a call to an SP to
> throw an error when it fails??????

I have also had this problem when using the ExecuteNonQuery() method.
My work-around was to check if the resultant number of rows affected
was 0. Then I would throw a custom error or take some other action.
E. Bender