DB2 Version 10.1 for Linux, UNIX, and Windows

DB2Exception.Message Property

Gets the text describing the error.

Namespace:
IBM®.Data.DB2®
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
<Serializable>
Overrides Public ReadOnly Property Message As String
[C#]
[Serializable]
public override string Message {get;}
[C++]
[Serializable]
public: __property virtual String* get_Message();
[JScript]
public
   Serializable
function get Message() : String;

Property value

The text describing the error.

Remarks

This is a wrapper for the DB2Error.Message property of the first DB2Error in the Errors property.

Example

[Visual Basic, C#] The following example displays the DB2Error.Message of the first DB2Error within a DB2ErrorCollection collection.

[Visual Basic]
Public Sub DisplayDB2ErrorCollection(myException As DB2Exception)
    MessageBox.Show("Message: " + myException.Message + ControlChars.Cr _
       + "StackTrace: " + myException.StackTrace + ControlChars.Cr
End Sub
End Class

[C#]
public void DisplayDB2ErrorCollection(DB2Exception myException)
{
   MessageBox.Show("Message: " + myException.Message + "\n" +
          "StackTrace: " + myException.StackTrace + "\n";
}