OleDbErrorCollection::Item Property (Int32)
.NET Framework (current version)
Gets the error at the specified index.
Assembly: System.Data (in System.Data.dll)
Parameters
- index
-
Type:
System::Int32
The zero-based index of the error to retrieve.
Property Value
Type: System.Data.OleDb::OleDbError^An OleDbError that contains the error at the specified index.
The following example displays each OleDbError within the OleDbErrorCollection collection.
public void DisplayOleDbErrorCollection(OleDbException myException) { for (int i=0; i < myException.Errors.Count; i++) { MessageBox.Show("Index #" + i + "\n" + "Message: " + myException.Errors[i].Message + "\n" + "Native: " + myException.Errors[i].NativeError.ToString() + "\n" + "Source: " + myException.Errors[i].Source + "\n" + "SQL: " + myException.Errors[i].SQLState + "\n"); } }
.NET Framework
Available since 1.1
Available since 1.1
OleDbErrorCollection Class
System.Data.OleDb Namespace
Exceptions Overview
Show: