LinkMenuExpand(external link)DocumentSearchCopyCopied

MySqlDataSource.OpenConnectionAsync method

Asynchronously returns a new, open MySqlConnection to the database represented by this MySqlDataSource.

public ValueTask<MySqlConnection> OpenConnectionAsync(CancellationToken cancellationToken = default)
parameterdescription
cancellationTokenA token to cancel the asynchronous operation.

Remarks

The returned connection is already open, and is ready for immediate use.

It is the responsibility of the caller to properly dispose the connection returned by this method. Failure to do so may result in a connection leak.

See Also