System.Data.OleDb Namespace
Represents an open connection to a data source.
An OleDbConnection object represents a unique connection to a data source. In the case of a client/server database system, it is equivalent to a network connection to the server. Depending on the functionality supported by the native OLE DB provider, some collections, methods, or properties of an OleDbConnection object may not be available.
When you create an instance of OleDbConnection, all properties are set to their initial values. For a list of these values, see the OleDbConnection constructor.
If the OleDbConnection goes out of scope, it is not closed. Therefore, you must explicitly close the connection by calling Close or Dispose.
If a fatal OleDbException ( for example, an SQL Server™ severity level of 20 or greater ) is generated by the method executing an OleDbCommand, the OleDbConnection, the connection may be closed. However, the user can reopen the connection and continue.
An application that initializes an instance of the OleDbConnection object can require all direct and indirect callers to have adequate permission to the code by setting declarative or imperative security demands. OleDbConnection makes security demands using the OleDbPermission object. Users can verify that their code has adequate permissions by using the OleDbPermissionAttribute object.
The following example uses an OleDbConnection to connect to an MS Access database and displays some of its properties.
Show me
OleDbDataAdapter OleDbCommand