D
David Rigler
SQLconn = new SqlConnection(dbConnectionString); has async=true
SQLconn.Open();
//
SQLcmd = new SqlCommand(SPName, SQLconn);
SQLcmd.CommandType = CommandType.StoredProcedure;
SQLcmd.CommandTimeout = 0;
// And start executing
IAsyncResult iaR = SQLcmd.BeginExecuteReader();
waitHandles[SQLEVENT] = iaR.AsyncWaitHandle;
int index = WaitHandle.WaitAny(waitHandles);
With this code the WaitHandle.WaitAny returns IMMEDIATELY with the
waitHandles[SQLEVENT] signaled. iaR.IsCompleted is also true?
The code then spends 5 minutes (its a long procedure) waiting for
SQLcmd.EndExecuteReader(iaR) to complete
How come its not waiting on the WaitHandle
thanks
dave
SQLconn.Open();
//
SQLcmd = new SqlCommand(SPName, SQLconn);
SQLcmd.CommandType = CommandType.StoredProcedure;
SQLcmd.CommandTimeout = 0;
// And start executing
IAsyncResult iaR = SQLcmd.BeginExecuteReader();
waitHandles[SQLEVENT] = iaR.AsyncWaitHandle;
int index = WaitHandle.WaitAny(waitHandles);
With this code the WaitHandle.WaitAny returns IMMEDIATELY with the
waitHandles[SQLEVENT] signaled. iaR.IsCompleted is also true?
The code then spends 5 minutes (its a long procedure) waiting for
SQLcmd.EndExecuteReader(iaR) to complete
How come its not waiting on the WaitHandle
thanks
dave