OdbcError.Message 속성

정의

오류에 대한 간단한 설명을 가져옵니다.

public:
 property System::String ^ Message { System::String ^ get(); };
public string Message { get; }
member this.Message : string
Public ReadOnly Property Message As String

속성 값

오류에 대한 설명입니다.

예제

다음 예제에서는 속성을 표시 합니다 OdbcError합니다.

public void DisplayOdbcErrorCollection(OdbcException exception)
{
    for (int i = 0; i < exception.Errors.Count; i++)
    {
        Console.WriteLine("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");
    }
    Console.ReadLine();
}
Public Sub DisplayOdbcErrorCollection(ByVal exception As OdbcException)
    Dim i As Integer

    For i = 0 To exception.Errors.Count - 1
        Console.WriteLine("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
    Console.ReadLine()
End Sub

적용 대상

추가 정보