See Also

OracleException Members  | Devart.Data.Oracle Namespace  | OracleConnection Class  | OracleCommand Class

Language

Visual Basic

C#

Show All

See AlsoLanguagesDevart.Data.OracleSend comments on this topic.

OracleException Class

Devart.Data.Oracle Namespace : OracleException Class

The exception that is generated when Oracle returns an error.

For a list of all members of this type, see OracleException members.

Inheritance Hierarchy

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

Syntax

[Visual Basic]
Public Class OracleException    Inherits DbException    Implements _ExceptionISerializable 
[C#]
public class OracleException : DbException, _ExceptionISerializable 

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 missing database, and then displays the exception.

[C#] 

public void ThrowOracleException() 

  string mySelectQuery = "SELECT * FROM Test.Dept"; 
  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"); 
  } 

[Visual Basic] 

Public Sub ThrowOracleException()
  Dim mySelectQuery As String = "SELECT * FROM Test.Dept"
  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

See Also

OracleException Members  | Devart.Data.Oracle Namespace  | OracleConnection Class  | OracleCommand Class

 

 


© 2002 - 2013 Devart. All Rights Reserved.