Skip Headers
Oracle® Data Provider for .NET Developer's Guide
11g Release 2 (11.2.0.3)

Part Number E23174-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

OracleErrorCollection Class

An OracleErrorCollection class represents a collection of all errors that are thrown by the Oracle Data Provider for .NET.

Class Inheritance

System.Object

  System.ArrayList

    Oracle.DataAccess.Client.OracleErrorCollection

Declaration

// C#
public sealed class OracleErrorCollection : ArrayList

Thread Safety

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

Remarks

A simple ArrayList that holds a list of OracleErrors.

If there are multiple errors, ODP.NET only returns the first error message on the stack.

Example

// C#
 
using System;
using System.Data;
using Oracle.DataAccess.Client;
 
class OracleErrorCollectionSample
{
  static void Main()
  {
    string constr = "User Id=scott;Password=tiger;Data Source=oracle";
    OracleConnection con = new OracleConnection(constr);
    con.Open();
 
    // Create an OracleCommand object using the connection object
    OracleCommand cmd = con.CreateCommand();
 
    try
    {
      cmd.CommandText = "insert into notable values (99, 'MyText')";
      cmd.ExecuteNonQuery();
    }
    catch (OracleException ex)
    {
      Console.WriteLine("Record is not inserted into the database table.");
 
      foreach (OracleError error in ex.Errors) 
      {
        Console.WriteLine("Error Message: " + error.Message);
        Console.WriteLine("Error Source: " + error.Source);         
      }
    }
  }
}

Requirements

Namespace: Oracle.DataAccess.Client

Assembly: Oracle.DataAccess.dll

ODP.NET Version: ODP.NET for .NET Framework 2.0 or ODP.NET for .NET Framework 4


OracleErrorCollection Members

OracleErrorCollection members are listed in the following tables.

OracleErrorCollection Static Methods

OracleErrorCollection static methods are listed in Table 5-56.

Table 5-56 OracleErrorCollection Static Methods

Method Description

Equals

Inherited from System.Object (Overloaded)


OracleErrorCollection Properties

OracleErrorCollection properties are listed in Table 5-57.

Table 5-57 OracleErrorCollection Properties

Property Description

Capacity

Inherited from System.Collections.ArrayList

Count

Inherited from System.Collections.ArrayList

IsReadOnly

Inherited from System.Collections.ArrayList

IsSynchronized

Inherited from System.Collections.ArrayList

Item

Inherited from System.Collections.ArrayList


OracleErrorCollection Public Methods

OracleErrorCollection public methods are listed in Table 5-58.

Table 5-58 OracleErrorCollection Public Methods

Public Method Description

CopyTo

Inherited from System.Collections.ArrayList

Equals

Inherited from System.Object (Overloaded)

GetHashCode

Inherited from System.Object

GetType

Inherited from System.Object

ToString

Inherited from System.Object



OracleErrorCollection Static Methods

The OracleErrorCollection static method is listed in Table 5-59.

Table 5-59 OracleErrorCollection Static Method

Method Description

Equals

Inherited from System.Object (Overloaded)



OracleErrorCollection Properties

OracleErrorCollection properties are listed in Table 5-60.

Table 5-60 OracleErrorCollection Properties

Property Description

Capacity

Inherited from System.Collections.ArrayList

Count

Inherited from System.Collections.ArrayList

IsReadOnly

Inherited from System.Collections.ArrayList

IsSynchronized

Inherited from System.Collections.ArrayList

Item

Inherited from System.Collections.ArrayList



OracleErrorCollection Public Methods

OracleErrorCollection public methods are listed in Table 5-61.

Table 5-61 OracleErrorCollection Public Methods

Public Method Description

CopyTo

Inherited from System.Collections.ArrayList

Equals

Inherited from System.Object (Overloaded)

GetHashCode

Inherited from System.Object

GetType

Inherited from System.Object

ToString

Inherited from System.Object