OdbcError.ToString Method
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 complete text of the error message.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Returns
The complete text of the error.
Examples
The following example displays each OdbcError within the OdbcErrorCollection collection.
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
Applies to
See also
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.