using (OleDbConnection connection = new OleDbConnection(@"Provider=Advantage OLE DB Provider; Data Source=" + this._DataPath)) { OleDbCommand command = new OleDbCommand(); OleDbTransaction transaction = null; try { connection.Open(); transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted); command.Connection = connection; command.Transaction = transaction; command.CommandText = "SELECT * FROM Commands"; OleDbDataAdapter adapter = new OleDbDataAdapter(command); adapter.Fill(this.commandsTable); command.CommandText = "DELETE FROM Commands"; int deletedRows = command.ExecuteNonQuery(); System.Windows.Forms.MessageBox.Show("deletedRows: " + deletedRows.ToString() + Environment.NewLine + "this.commandsTable.Rows.Count() : " + this.commandsTable.Rows.Count.ToString()); if (deletedRows == this.commandsTable.Rows.Count) { transaction.Commit(); } else { transaction.Rollback(); } } catch (Exception ex) { try { transaction.Rollback(); } catch{ //don't worry about it} } }