Releases the resources used by the DB2Connection.
Name | Description |
---|---|
Dispose(Boolean) | Releases the unmanaged and, optionally, the managed resources used by the DB2®Connection. |
Dispose() | Inherited from Component. |
[Visual Basic, C#] The following example creates a DB2Connection and then disposes of it.
[Visual Basic]
Public Sub DB2ConnectionHereAndGone()
Dim myConnection As New DB2Connection()
myConnection.Open()
'Calling Dispose also calls DB2Connection.Close.
myConnection.Dispose()
End Sub
[C#]
public void DB2ConnectionHereAndGone()
{
DB2Connection myConnection = new DB2Connection();
myConnection.Open();
//Calling Dispose also calls DB2Connection.Close.
myConnection.Dispose();
}