DB2Error.Source Property
Gets the name of the driver that generated the error.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
<Serializable>
Public ReadOnly Property Source As String
[C#]
[Serializable]
public string Source {get;}
[C++]
[Serializable]
public: __property String* get_Source();
[JScript]
public
Serializable
function get Source() : String;
Property value
The name of the driver that generated the error. This value is currently "IBM®.Data.DB2®".
Example
[Visual Basic, C#] The following example displays the properties of a DB2Error .
[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");
}
}