OleDbErrorCollection Class

OleDbErrorCollection Class

 

Collects all errors generated by the .NET Framework Data Provider for OLE DB. This class cannot be inherited.

Namespace:   System.Data.OleDb
Assembly:  System.Data (in System.Data.dll)

System.Object
  System.Data.OleDb.OleDbErrorCollection

<SerializableAttribute>
<ListBindableAttribute(False)>
Public NotInheritable Class OleDbErrorCollection
	Implements ICollection, IEnumerable

NameDescription
System_CAPS_pubpropertyCount

Gets the number of errors in the collection.

System_CAPS_pubpropertyItem(Int32)

Gets the error at the specified index.

NameDescription
System_CAPS_pubmethodCopyTo(Array, Int32)

Copies the elements of the OleDbErrorCollection into an Array, starting at the specified index within the Array.

System_CAPS_pubmethodCopyTo(OleDbError(), Int32)

Copies all the elements of the current OleDbErrorCollection to the specified OleDbErrorCollection starting at the specified destination index.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Exposes the GetEnumerator method, which supports a simple iteration over a collection by a .NET Framework data provider.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

For a description of this member, see M:System.Collections.ICollection.IsSynchronized.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

For a description of this member, see M:System.Collections.ICollection.SyncRoot.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast(Of TResult)()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType(Of TResult)()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

This class is created by OleDbException to collect instances of the OleDbError class. OleDbErrorCollection always contains at least one instance of the OleDbError class.

The following example displays each OleDbError within the OleDbErrorCollection collection.

Public Sub DisplayOleDbErrorCollection(exception As OleDbException)
    Dim i As Integer

    For i = 0 To exception.Errors.Count - 1
        MessageBox.Show("Index #" + i.ToString() + ControlChars.Cr _
           + "Message: " + exception.Errors(i).Message + ControlChars.Cr _
           + "Native: " + exception.Errors(i).NativeError.ToString() + ControlChars.Cr _
           + "Source: " + exception.Errors(i).Source + ControlChars.Cr _
           + "SQL: " + exception.Errors(i).SQLState + ControlChars.Cr)
    Next i
End Sub

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft