コード例 #1
0
 private IAsyncResult DoBeginExecuteXmlReader(SqlCommand command, AsyncCallback callback, object state)
 {
     return(WrappedAsyncOperation.BeginAsyncOperation(
                callback,
                cb => command.BeginExecuteXmlReader(cb, state),
                ar => new DaabAsyncResult(ar, command, false, false, DateTime.Now)));
 }
コード例 #2
0
        private IAsyncResult DoBeginExecuteNonQuery(SqlCommand command, bool disposeCommand, AsyncCallback callback, object state)
        {
            bool closeConnection = command.Transaction == null;

            return(WrappedAsyncOperation.BeginAsyncOperation(
                       callback,
                       cb => command.BeginExecuteNonQuery(cb, state),
                       ar => new DaabAsyncResult(ar, command, disposeCommand, closeConnection, DateTime.Now)));
        }
コード例 #3
0
        private IAsyncResult DoBeginExecuteReader(SqlCommand command, bool disposeCommand, AsyncCallback callback, object state)
        {
            CommandBehavior commandBehavior =
                command.Transaction == null ? CommandBehavior.CloseConnection : CommandBehavior.Default;

            return(WrappedAsyncOperation.BeginAsyncOperation(
                       callback,
                       cb => command.BeginExecuteReader(cb, state, commandBehavior),
                       ar => new DaabAsyncResult(ar, command, disposeCommand, false, DateTime.Now)));
        }