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))); }
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))); }
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))); }