OleDbErrorCollection.Item[Int32] Tulajdonság

Definíció

Lekéri a hibát a megadott indexben.

public:
 property System::Data::OleDb::OleDbError ^ default[int] { System::Data::OleDb::OleDbError ^ get(int index); };
public System.Data.OleDb.OleDbError this[int index] { get; }
member this.Item(int) : System.Data.OleDb.OleDbError
Default Public ReadOnly Property Item(index As Integer) As OleDbError

Paraméterek

index
Int32

A lekérendő hiba nulla alapú indexe.

Tulajdonság értéke

Olyan OleDbError , amely a megadott indexben található hibát tartalmazza.

Megjegyzések

Az alábbi példa mindegyik OleDbError a gyűjteményen OleDbErrorCollection belül jelenik meg.

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");  
     }  
  }  

A következőre érvényes:

Lásd még