OdbcError.Source Eigenschaft

Definition

Ruft den Namen des Treibers ab, der den Fehler generiert hat.Gets the name of the driver that generated the error.

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

Eigenschaftswert

Der Name des Treibers, der den Fehler generiert hat.The name of the driver that generated the error.

Beispiele

Im folgenden Beispiel werden die Eigenschaften eines OdbcErrorangezeigt.The following example displays the properties of an 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

Gilt für:

Siehe auch