OleDbErrorCollection.Item[Int32] 属性   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取位于指定索引处的错误。
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.OleDbErrorDefault Public ReadOnly Property Item(index As Integer) As OleDbError参数
- index
- Int32
要检索的错误的从零开始的索引。
属性值
包含在指定索引位置的错误的 OleDbError。
注解
以下示例显示 OleDbError 集合中的每个 OleDbErrorCollection 。
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");  
     }  
  }