Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

OdbcConnection::Open Method ()

 

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

Namespace:   System.Data.Odbc
Assembly:  System.Data (in System.Data.dll)

public:
virtual void Open() override

Exception Condition
NotSupportedException

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

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

System_CAPS_noteNote

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.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft