OleDbErrorCollection.Count Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the number of errors in the collection.
public:
property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer
Property Value
The total number of errors in the collection.
Implements
Examples
The following example displays each OleDbError within the OleDbErrorCollection collection.
public void DisplayOleDbErrorCollection(OleDbException exception)
{
for (int i=0; i < exception.Errors.Count; i++)
{
MessageBox.Show("Index #" + i + "\n" +
"Message: " + exception.Errors[i].Message + "\n" +
"Native: " + exception.Errors[i].NativeError.ToString() + "\n" +
"Source: " + exception.Errors[i].Source + "\n" +
"SQL: " + exception.Errors[i].SQLState + "\n");
}
}
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
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET