Editare

Partajați prin


OdbcConnection.Open Method

Definition

Opens a connection to a data source with the property settings specified by the ConnectionString.

public:
 override void Open();
public:
 virtual void Open();
public override void Open ();
public void Open ();
override this.Open : unit -> unit
abstract member Open : unit -> unit
override this.Open : unit -> unit
Public Overrides Sub Open ()
Public Sub Open ()

Implements

Exceptions

The functionality of this method is unsupported in the base class and must be implemented in a derived class instead.

Remarks

The OdbcConnection draws an open connection from the connection pool if one is available. Otherwise, it establishes a new connection to the data source.

Note

If the OdbcConnection goes out of scope, the connection it represents does not close automatically. Therefore, you must explicitly close the connection by calling Close, Dispose, or by placing the connection within a Using statement.

Applies to

See also