Bagikan melalui


OdbcError.ToString Metode

Definisi

Mendapatkan teks lengkap pesan kesalahan.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Mengembalikan

Teks lengkap kesalahan.

Contoh

Contoh berikut menampilkan masing-masing OdbcError dalam OdbcErrorCollection koleksi.

public void DisplayOdbcErrors(OdbcException exception)
{
    for (int i = 0; i < exception.Errors.Count; i++)
    {
        Console.WriteLine("Index #" + i + "\n" +
            "Error: " + exception.Errors[i].ToString() + "\n");
    }
    Console.ReadLine();
}
Public Sub DisplayOdbcErrors(ByVal exception As OdbcException)
    Dim i As Integer

    For i = 0 To exception.Errors.Count - 1
        Console.WriteLine("Index #" & i.ToString() & ControlChars.Cr _
           & "Error: " & exception.Errors(i).ToString() & ControlChars.Cr)
    Next i
    Console.ReadLine()
End Sub

Berlaku untuk

Lihat juga