예제 #1
0
 public virtual IAsyncResult BeginExecuteNonQuery(AsyncCallback callback, object state)
 {
     if (IsTraced)
     {
         Tracer.Instance.EnterFunction(TraceClass, "AsyncExecuteNonQuery", new string[] { "CommandText", "callback", "state", "Parameters" }, new object[] { this.CommandText, callback, state, this.GetTraceParameters(true) });
     }
     this.AsyncExecuteNonQuery = new AsyncExecuteNonQueryHandler(this.ExecuteNonQuery);
     return(this.AsyncExecuteNonQuery.BeginInvoke(callback, state));
 }
예제 #2
0
        public virtual int EndExecuteNonQuery(IAsyncResult asyncResult)
        {
            ParameterChecker.CheckNull("DbAccessCommand.EndExecuteNonQuery", "AsyncExecuteNonQuery", this.AsyncExecuteNonQuery);
            ParameterChecker.CheckNull("DbAccessCommand.EndExecuteNonQuery", "asyncResult", asyncResult);
            int result = this.AsyncExecuteNonQuery.EndInvoke(asyncResult);

            this.AsyncExecuteNonQuery = null;
            if (IsTraced)
            {
                Tracer.Instance.LeaveFunction(TraceClass, "AsyncExecuteNonQuery", new string[] { "asyncResult", "result", "Parameters" }, new object[] { "Null:" + (asyncResult == null), result, this.GetTraceParameters(false) });
            }
            return(result);
        }