System.Data.OleDb Namespace OleDbConnection Class
Releases the resources used by the OleDbConnection.
1. Releases the unmanaged resources used by the OleDbConnection and optionally releases the managed resources.
2. Inherited from Component.
The following example initializes an OleDbConnection and then disposes of it.
NOTE: This example shows how to use one of the overloaded versions of Dispose. For other examples that may be available, see the individual overload topics.
[ VB ]
Public Sub OleDbConnectionHereAndGone ( )
Dim myConnection As New OleDbConnection ( )
myConnection.Open ( )
'Calling Dispose also calls OleDbConnection.Close.
myConnection.Dispose ( )
End Sub
[ C# ]
void OleDbConnectionHereAndGone ( )
{
OleDbConnection myConnection = new OleDbConnection ( );
myConnection.Open ( );
//Calling Dispose also calls OleDbConnection.Close.
myConnection.Dispose ( );
}
OleDbConnection Members