public void Dispose() { reader.Dispose(); if (closeConn) { db.CloseConnection(conn); } }
/// <summary> /// Close transaction and connection. If transaction has not been rolled back, it is committed /// </summary> public void Dispose() { GC.SuppressFinalize(this); try { if (DBTransaction != null) { DBTransaction.Commit(); DBTransaction.Dispose(); DBTransaction = null; } if (disposeConnection) { db.CloseConnection(DBConnection); } DBConnection = null; } catch { // don't care } }