OleDbError.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 OleDbError within the OleDbErrorCollection collection.
public void DisplayOleDbErrors(OleDbException exception)
{
for (int i=0; i < exception.Errors.Count; i++)
{
MessageBox.Show("Index #" + i + "\n" +
"Error: " + exception.Errors[i].ToString() + "\n");
}
}
Public Sub DisplayOleDbErrors(exception As OleDbException)
Dim i As Integer
For i = 0 To exception.Errors.Count - 1
MessageBox.Show("Index #" + i.ToString() + ControlChars.Cr _
+ "Error: " + exception.Errors(i).ToString() + ControlChars.Cr)
Next i
End Sub
Remarks
The string is in the form "OleDbError:", followed by the Message, and the stack trace. For example:
OleDbError:UserId or Password not valid. <stack trace>
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor