Asynchronously opens a Teradata session using the attributes specified via the
TdConnection.ConnectionString.
Parameters
- cancellationToken
- A Threading.CancellationToken used to indicate that the asynchronous operation should be canceled.
Return Value
Returns a Task that may be awaited or monitored for completion.
The following example creates a
TdConnection class and illustrates the use of
OpenAsync and
Close methods.
public async Task<Boolean> TestConnectivityAsync(String connectionString)
{
Boolean connectivity = false;
TdConnection cn = new TdConnection(connectionString);
try
{
await cn.OpenAsync();
connectivity = true;
}
catch(Exception)
{
connectivity = false;
}
cn.Close();
return connectivity;
}
Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2