asp.net.ph

OleDbConnection.Dispose Method

System.Data.OleDb Namespace   OleDbConnection Class


Releases the resources used by the OleDbConnection.

Overload List

1. Releases the unmanaged resources used by the OleDbConnection and optionally releases the managed resources.

2. Inherited from Component.


Example

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 ( );
}
See Also

OleDbConnection Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph