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

On this page
    OracleException Class
    On this page
    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 oracleConnection =
        new OracleConnection(
            "User Id=Scott;Password=tiger;Data Source=Ora;");
      OracleCommand oracleCommand = new OracleCommand(mySelectQuery,oracleConnection);
      try
      {
        oracleCommand.Connection.Open();
      }
      catch (OracleException myException)
      {
        MessageBox.Show("Message: " + myException.Message + "\n");
      }
    }
    Public Sub ThrowOracleException()
      Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
      Dim oracleConnection As New OracleConnection( _
        "User Id=Scott;Password=tiger;Data Source=Ora;")
      Dim oracleCommand As New OracleCommand(mySelectQuery, oracleConnection)
      Try
        oracleCommand.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

    See Also