OdbcException.Errors Property
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 a collection of one or more OdbcError objects that give detailed information about exceptions generated by the .NET Framework Data Provider for ODBC.
public:
property System::Data::Odbc::OdbcErrorCollection ^ Errors { System::Data::Odbc::OdbcErrorCollection ^ get(); };
public System.Data.Odbc.OdbcErrorCollection Errors { get; }
member this.Errors : System.Data.Odbc.OdbcErrorCollection
Public ReadOnly Property Errors As OdbcErrorCollection
Property Value
The collected instances of the OdbcError class.
Examples
The following example displays each OdbcError within an OdbcErrorCollection collection.
public void DisplayOdbcErrorCollection(OdbcException exception)
{
for (int i=0; i < exception.Errors.Count; i++)
{
MessageBox.Show("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");
}
}
Public Sub DisplayOdbcErrorCollection(exception As OdbcException)
Dim i As Integer
For i = 0 To exception.Errors.Count - 1
MessageBox.Show("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
End Sub
Remarks
This property is a wrapper for the OdbcErrorCollection.
Applies to
See also
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour