DB2Command.Dispose (Boolean) Method

Releases the unmanaged and, optionally, the managed resources used by the DB2Command object.

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

Syntax


[Visual Basic]
Overrides Overloads Protected Sub Dispose( _
   ByVal disposing As Boolean _
)
[C#]
protected override void Dispose(
   bool disposing
);
[C++]
protected: void Dispose(
   bool disposing
);
[JScript]
protected override function Dispose(
   disposing : Boolean
);

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the public Dispose method. Dispose() invokes the protected Dispose(Boolean) method with the disposing parameter set to true.

When the disposing parameter is true, the method releases all resources held by any managed objects that this DB2®Command references. It does this by invoking the Dispose() method of each referenced object.

Notes to inheritors:

Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects that have been previously disposed of in an earlier call to Dispose. For more information about how to implement Dispose(Boolean), see "Implementing a Dispose Method" in the Microsoft(R) .NET Framework SDK documentation.

Example

[Visual Basic, C#] The following example creates a DB2Command and then disposes of it.

[Visual Basic]
Public Sub DB2CommandHereAndGone()
    Dim myCommand As New DB2Command()
    myCommand.Dispose()
End Sub

[C#]
public void DB2CommandHereAndGone()
{
   DB2Command myCommand = new DB2Command();
   myCommand.Dispose();
}