Skip Headers

Oracle® Data Provider for .NET Developer's Guide
Release 9.2.0.4

Part Number B10961-01
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to beginning of chapter Go to next page

Oracle.DataAccess.Client Namespace, 7 of 30


OracleError Class

The OracleError class represents an error reported by Oracle.

Class Inheritance

Object

  OracleError

Declaration
// C#
public sealed class OracleError
Thread Safety

All public static methods are thread-safe, although instance methods do not guarantee thread safety.

Remarks

The OracleError class represents a warning or an error reported by Oracle.

Example
// C#
...
try {
    cmd.ExecuteNonQuery()
}
catch ( OracleException e ){
   OracleError err1 = e.Errors[0];
   OracleError err2 = e.Errors[1];

    Console.WriteLine("Error 1 Message:", err1.Message);
    Console.WriteLine("Error 2 Source:", err2.Source);
}
Requirements

Namespace: Oracle.DataAccess.Client

Assembly: Oracle.DataAccess.dll

See Also:

OracleError Members

OracleError members are listed in the following tables:

OracleError Static Methods

OracleError static methods are listed in Table 4-49.

Table 4-49 OracleError Static Methods
Methods Description

Equals

Inherited from Object (Overloaded)

OracleError Properties

OracleError properties are listed in Table 4-50.

Table 4-50 OracleError Properties  
Properties Description

ArrayBindIndex

Specifies the row number of errors that occurred during the Array Bind execution

DataSource

Specifies the Oracle service name (TNS name) that identifies the Oracle database

Message

Specifies the message describing the error

Number

Specifies the Oracle error number

Procedure

Specifies the stored procedure that causes the error

Source

Specifies the name of the data provider that generates the error

OracleError Methods

OracleError methods are listed in Table 4-51.

Table 4-51 OracleError Methods  
Methods Description

Equals

Inherited from Object (Overloaded)

GetHashCode

Inherited from Object

GetType

Inherited from Object

ToString

Returns a string representation of the OracleError

See Also:

OracleError Static Methods

OracleError static methods are listed in Table 4-52.

Table 4-52 OracleError Static Methods
Methods Description

Equals

Inherited from Object (Overloaded)

See Also:

OracleError Properties

OracleError properties are listed in Table 4-53.

Table 4-53 OracleError Properties  
Properties Description

ArrayBindIndex

Specifies the row number of errors that occurred during the Array Bind execution

DataSource

Specifies the Oracle service name (TNS name) that identifies the Oracle database

Message

Specifies the message describing the error

Number

Specifies the Oracle error number

Procedure

Specifies the stored procedure that causes the error

Source

Specifies the name of the data provider that generates the error

See Also:

ArrayBindIndex

This property specifies the row number of errors that occurred during the Array Bind execution.

Declaration
// C#
public int ArrayBindIndex {get;}
Property Value

An int value that specifies the row number for errors that occurred during the Array Bind execution.

Remarks

Default = 0.

This property is used for Array Bind operations only.

ArrayBindIndex represents the zero-based row number at which the error occurred during an Array Bind operation. For example, if an array bind execution causes two errors on the 2nd and 4th operations, two OracleError objects appear in the OracleErrorCollection with the ArrayBindIndex property values 2 and 4 respectively.

See Also:

DataSource

This property specifies the Oracle service name (TNS name) that identifies the Oracle database.

Declaration
// C#
public string DataSource {get;}
Property Value

A string.

See Also:

Message

This property specifies the message describing the error.

Declaration
// C#
public string Message {get;}
Property Value

A string.

See Also:

Number

This property specifies the Oracle error number.

Declaration
// C#
public int Number {get;}
Property Value

An int.

See Also:

Procedure

This property specifies the stored procedure that causes the error.

Declaration
// C#
public string Procedure {get;}
Property Value

The stored procedure name.

Remarks

Represents the stored procedure which creates this OracleError object.

See Also:

Source

This property specifies the name of the data provider that generates the error.

Declaration
// C#
public string Source {get;}
Property Value

A string.

See Also:

OracleError Methods

OracleError methods are listed in Table 4-54.

Table 4-54 OracleError Methods  
Methods Description

Equals

Inherited from Object (Overloaded)

GetHashCode

Inherited from Object

GetType

Inherited from Object

ToString

Returns a string representation of the OracleError

See Also:

ToString

Overrides Object

This method returns a string representation of the OracleError.

Declaration
// C#
public override string ToString();
Return Value

Returns a string with the format Ora- error number: Class.Method name error message stack trace information.

Example

ORA-24333: zero iteration count

See Also:


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2002, 2003 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents
Go To Index
Index