DB2Error.Message Property
Gets a short description of the error.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
<Serializable>
Public ReadOnly Property Message As String
[C#]
[Serializable]
public string Message {get;}
[C++]
[Serializable]
public: __property String* get_Message();
[JScript]
public
Serializable
function get Message() : String;
Property value
A description of the error.
For .NET, whenever a server error is detected against and Informix® database server and an ISAM error code is detected in the SQLCA, the text of that ISAM error will be appended to the Message property of the DB2Error object generated as a result of the error. This is a sample of how a message with ISAM information will be formatted: [IBM][CLI Driver][IDS/UNIX64] Cannot read system catalog (systables) (-144 ISAM error: key value locked) The description of this property will be enhanced to indicate it will include ISAM error information:
Example
[Visual Basic, C#] The following example displays the properties of the DB2®Error .
[Visual Basic]
Public Sub DisplayDB2ErrorCollection(myException As DB2Exception)
Dim i As Integer
For i = 0 To myException.Errors.Count - 1
MessageBox.Show("Index #" + i.ToString() + ControlChars.Cr _
+ "Message: " + myException.Errors(i).Message + ControlChars.Cr _
+ "Native: " + myException.Errors(i).NativeError.ToString()
+ ControlChars.Cr _
+ "Source: " + myException.Errors(i).Source + ControlChars.Cr _
+ "SQL: " + myException.Errors(i).SQLState + ControlChars.Cr)
Next i
End Sub
[C#]
public void DisplayDB2ErrorCollection(DB2Exception myException)
{
for (int i=0; i < myException.Errors.Count; i++)
{
MessageBox.Show("Index #" + i + "\n" +
"Message: " + myException.Errors[i].Message + "\n" +
"Native: " + myException.Errors[i].NativeError.ToString() + "\n" +
"Source: " + myException.Errors[i].Source + "\n" +
"SQL: " + myException.Errors[i].SQLState + "\n");
}
}