dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleException Class
Members Example

OracleException Class
The exception that is generated when Oracle returns an error.
Syntax
Remarks
This class is created whenever dotConnect for Oracle encounters an error generated by the server, or OracleConnection has been closed before attempting to execute an operation on the server.
Example
The following example generates a OracleException due to a non-existing table, and then displays the exception.
public void ThrowOracleException()
{
  string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
  OracleConnection myConnection =
    new OracleConnection(
        "User Id=Scott;Password=tiger;Data Source=Ora;");
  OracleCommand myCommand = new OracleCommand(mySelectQuery,myConnection);
  try
  {
    myCommand.Connection.Open();
  }
  catch (OracleException myException)
  {
    MessageBox.Show("Message: " + myException.Message + "\n");
  }
}
Public Sub ThrowOracleException()
  Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
  Dim myConnection As New OracleConnection( _
    "User Id=Scott;Password=tiger;Data Source=Ora;")
  Dim myCommand As New OracleCommand(mySelectQuery, myConnection)
  Try
    myCommand.Connection.Open()
  Catch myException As OracleException
    MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
  End Try
End Sub
Inheritance Hierarchy

System.Object
   System.Exception
      System.SystemException
         System.Runtime.InteropServices.ExternalException
            System.Data.Common.DbException
               Devart.Data.Oracle.OracleException

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also