Initiates the asynchronous request that is to be submitted to Teradata. This method differs from
TdCommand.BeginExecuteReader in that it should not be used when retrieving data. A TdDataReader object is not returned when the corresponding
TdCommand.EndExecuteNonQuery method is called.
The following example invokes an asynchronous request.
public void BeginExecute(String connectionString, String CommandText)
{
TdConnection cn = new TdConnection(connectionString);
cn.Open();
IAsyncResult asyncResult;
TdCommand cmd = new TdCommand(commandText, cn);
//going to start asynchronous request
asyncResult = cmd.BeginExecuteNonQuery();
// going to perform other tasks
//waiting for asynchronous execute to finish
asyncResult.AsyncWaitHandle.WaitOne();
//going to end the asynchronous request
cmd.EndExecuteNonQuery(asyncResult);
cn.Close();
}
Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019