Beispiel #1
0
        private static void RunThread3(string ConnectionString, string CommandText, CommandType commType, SqlParameterCollection Parameters)
        {
            // Create the delegate.
            AsynchProcedure2 caller = new AsynchProcedure2(ExecuteProcedure2);

            // Initiate the asychronous call.
            IAsyncResult result = caller.BeginInvoke(ConnectionString, CommandText, commType, Parameters, GetGlobalInputs(), null, null);

            // Wait for the WaitHandle to become signaled.
            result.AsyncWaitHandle.WaitOne();

            // Call EndInvoke to retrieve the results.
            caller.EndInvoke(result);

            // Close the wait handle.
            result.AsyncWaitHandle.Close();
            caller = null;
            result = null;
        }
Beispiel #2
0
        private static void RunThread3(string ConnectionString, string CommandText, CommandType commType, SqlParameterCollection Parameters)
        {
            // Create the delegate.
            AsynchProcedure2 caller = new AsynchProcedure2(ExecuteProcedure2);

            // Initiate the asychronous call.
            IAsyncResult result = caller.BeginInvoke(ConnectionString, CommandText, commType, Parameters, GetGlobalInputs(), null, null);

            // Wait for the WaitHandle to become signaled.
            result.AsyncWaitHandle.WaitOne();

            // Call EndInvoke to retrieve the results.
            caller.EndInvoke(result);

            // Close the wait handle.
            result.AsyncWaitHandle.Close();
            caller = null;
            result = null;
        }