Home All Groups Group Topic Archive Search About

Catching exception of System.Data.OleDb.OleDbException type

Author
24 Apr 2006 4:32 AM
Nits
Hello All,

I wanted to know what kind of exceptions will be catched in the class
type of
System.Data.OleDb.OleDbException

I was expecting the database constraints violations errors will fall
into this type
of exception handling, but it doesnt seem so. And if it cannot catch
these exceptions
then what type will catch database constraints violations errors ?

Thanks,
Nitin.

Author
24 Apr 2006 7:29 AM
Miha Markic [MVP C#]
Are you using OleDb managed provider?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Nits" <nitinv***@gmail.com> wrote in message
news:1145853177.303491.123050@t31g2000cwb.googlegroups.com...
> Hello All,
>
> I wanted to know what kind of exceptions will be catched in the class
> type of
> System.Data.OleDb.OleDbException
>
> I was expecting the database constraints violations errors will fall
> into this type
> of exception handling, but it doesnt seem so. And if it cannot catch
> these exceptions
> then what type will catch database constraints violations errors ?
>
> Thanks,
> Nitin.
>
Author
25 Apr 2006 2:04 AM
nitinvraj@gmail.com
I am using OleDbConnection object and Oracle Provider for OLE DB

The connection string is like this

"Provider=OraOLEDB.Oracle.1;Password=password;
Persist Security Info=True;User ID=User;Data Source =DS;"

Nitin.
Author
25 Apr 2006 9:58 AM
Miha Markic [MVP C#]
Try setting a catch block that catches all exceptions and see what type are
they, like:
try
....
catch (Exception ex)
{
    // ... check ex's type here
}
An observations: Why don't you use managed Oracle provider?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


<nitinv***@gmail.com> wrote in message
Show quote
news:1145930698.302856.65600@g10g2000cwb.googlegroups.com...
>
> I am using OleDbConnection object and Oracle Provider for OLE DB
>
> The connection string is like this
>
> "Provider=OraOLEDB.Oracle.1;Password=password;
> Persist Security Info=True;User ID=User;Data Source =DS;"
>
> Nitin.
>
Author
26 Apr 2006 2:49 AM
nitinvraj@gmail.com
you mean I should use

System.Data.OracleClient.OracleConnection object ?

Nitin.
Author
26 Apr 2006 7:31 AM
Miha Markic [MVP C#]
Sure, why not if you are dealing with Oracle.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

<nitinv***@gmail.com> wrote in message
Show quote
news:1146019765.245821.92820@y43g2000cwc.googlegroups.com...
> you mean I should use
>
> System.Data.OracleClient.OracleConnection object ?
>
> Nitin.
>

AddThis Social Bookmark Button