.NETGURU
SP fails, but OleDbCommand does not throw error!
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.adonet.

Post a new message to this list...

John Mark Howell
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

Reply to this message...
 
    
Edward Bender
On 2004-09-07 09:52:27 -0500, "John Mark Howell"
<Click here to reveal e-mail address> said:

[Original message clipped]

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

Reply to this message...
 
    
Robert Bouillon
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" <Click here to reveal e-mail address> wrote in message
news:uZ%Click here to reveal e-mail address...
> BlankI have found a major problem with the OleDb portion of ADO.NET. If
you
[Original message clipped]

Reply to this message...
 
    
Robert Bouillon
Correction: OleDB Providers. :) It's one of those mornings.

--ROBERT

"Robert Bouillon" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Data.OleDb.OleDbCommand




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification