asp.net.ph

OleDbConnection Class

System.Data.OleDb Namespace


Represents an open connection to a data source.

OleDbConnection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public OleDbConnection ( String connectionString )
public OleDbConnection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public ConnectionString String [ Get , Set ]
public ConnectionTimeout Int32 [ Get ]
public Database String [ Get ]
public DataSource String [ Get ]
public Provider String [ Get ]
public ServerVersion String [ Get ]
public State ConnectionState [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
protected BeginDbTransaction ( IsolationLevel isolationLevel ) DbTransaction
public BeginTransaction ( IsolationLevel isolationLevel ) OleDbTransaction
public BeginTransaction ( ) OleDbTransaction
public ChangeDatabase ( String value ) Void
public Close ( ) Void
public CreateCommand ( ) OleDbCommand
protected CreateDbCommand ( ) DbCommand
protected Dispose ( Boolean disposing ) Void
public EnlistDistributedTransaction ( ITransaction transaction ) Void
public EnlistTransaction ( Transaction transaction ) Void
public GetOleDbSchemaTable ( Guid schema , Object restrictions ) DataTable
public GetSchema ( ) DataTable
public GetSchema ( String collectionName ) DataTable
public GetSchema ( String collectionName , String restrictionValues ) DataTable
public Open ( ) Void
public static ReleaseObjectPool ( ) Void
public ResetState ( ) Void

Collapse   Events

Multicast Name Type
multicast InfoMessage OleDbInfoMessageEventHandler

Remarks

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.

Example

The following example uses an OleDbConnection to connect to an MS Access database and displays some of its properties.

 Show me 

See Also

OleDbDataAdapter   OleDbCommand 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