|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Catching exception of System.Data.OleDb.OleDbException typeHello 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. Are you using OleDb managed provider?
-- Show quoteMiha Markic [MVP C#] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "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. > 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. 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? -- Show quoteMiha 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 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. > you mean I should use
System.Data.OracleClient.OracleConnection object ? Nitin. Sure, why not if you are dealing with Oracle.
-- Show quoteMiha 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 news:1146019765.245821.92820@y43g2000cwc.googlegroups.com... > you mean I should use > > System.Data.OracleClient.OracleConnection object ? > > Nitin. > |
|||||||||||||||||||||||