Export (0) Print
Expand All

SqlConnection.OpenAsync Method

.NET Framework 4.6 and 4.5

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method OpenAsync() An asynchronous version of Open, which opens a database connection with the settings specified by the ConnectionString. This method invokes the virtual method OpenAsync with CancellationToken.None. (Inherited from DbConnection.)
Public method OpenAsync(CancellationToken) An asynchronous version of Open, which opens a database connection with the property settings specified by the ConnectionString. The cancellation token can be used to request that the operation be abandoned before the connection timeout elapses. Exceptions will be propagated via the returned Task. If the connection timeout time elapses without successfully connecting, the returned Task will be marked as faulted with an Exception. The implementation returns a Task without blocking the calling thread for both pooled and non-pooled connections. (Overrides DbConnection.OpenAsync(CancellationToken).)
Top
Show:
© 2015 Microsoft