AdgConnection.Open Method

Estimated reading time: 2 minutes

Definition

Namespace: ASNA.DataGate.Client
Assembly: ASNA.QSys.DataGate.Client.dll

Open a database connection.

Overloads

Signature Description
Open(CancellationToken) Opens a connection to the database with default options.
Open(OpenOptions, CancellationToken) Opens a connection to the database with the specified options.

void Open(CancellationToken ct)

Opens a connection to the database with default options.

Remarks

This method is used to transition an AdgConnection object to the Open state. If successful, a new database connection is established. The characteristics of the new connection may be specified by prior assignment of the SourceProfile property, or by specifying a SourceProfile object in the AdgConnection constructor.

This method opens a connection to the database with default options.

If the connection is already open, it returns immediately.

The ct parameter can be used to request cancellation of the operation. If the operation is canceled, it throws an OperationCanceledException.

void Open(CancellationToken ct)

Parameters

Type Parameter name Description
CancellationToken ct A cancellation token that can be used to cancel the operation.

void Open(OpenOptions openOptions, CancellationToken ct)

Opens a connection to the database with the specified options.

Remarks

This method is used to transition an AdgConnection object to the Open state. If successful, a new database connection is established. The characteristics of the new connection may be specified by prior assignment of the SourceProfile property, or by specifying a SourceProfile object in the AdgConnection constructor.

This method opens a connection to the database with the specified options.

If the connection is already open, it returns immediately.

The ct parameter can be used to request cancellation of the operation. If the operation is canceled, it throws an OperationCanceledException.

void Open(OpenOptions openOptions, CancellationToken ct)

Parameters

Type Parameter name Description
OpenOptions openOptions The options for opening the connection.
CancellationToken ct A cancellation token that can be used to cancel the operation.

See Also

AdgConnection Class