JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Immediate Solutions: Using the OleDbConnection Class

The OleDbDataConnection class represents a connection to an OLE DB data source. Here is the inheritance hierarchy of this class:

Object
   MarshalByRefObject
      Component
         OleDbConnection

You can find the more notable public properties of OleDbConnection objects in Table 22.1, their more notable methods in Table 22.2, and their more notable events in Table 22.3.

Table 22.1: Noteworthy public properties of OleDbConnection objects.

Property

Means

ConnectionString

Gets/sets the connection string to open a database.

ConnectionTimeout

Gets the amount of time to wait trying to make a connection.

Database

Gets the name of the database to open.

DataSource

Gets the data source (usually the location and file name to open).

Provider

Gets the OLE DB provider's name.

ServerVersion

Gets the version of the server.

State

Gets the connection's current state.

Table 22.2: Noteworthy public methods of OleDbConnection objects.

Method

Means

BeginTransaction

Starts a database transaction.

ChangeDatabase

Changes the current database.

Close

Closes the connection to the data provider.

CreateCommand

Creates an OleDbCommand object for this connection.

GetOleDbSchemaTable

Returns the current schema table.

Open

Opens a database connection.

Table 22.3: Noteworthy public events of OleDbConnection objects.

Event

Means

InfoMessage

Occurs if the provider sends a message (including warnings).

StateChange

Occurs when a connection's state changes.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor