DB2 Version 10.1 for Linux, UNIX, and Windows

DB2Exception.Source Property

Gets the name of the driver that generated the error.

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

Syntax

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

Property value

IBM.Data.DB2

Remarks

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

Example

[Visual Basic, C#] The following example displays the DB2Error.Message, DB2Error.Source, and stack trace properties of the first DB2Error within the DB2ErrorCollection collection.

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

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