Exemplo n.º 1
0
 public void Dispose()
 {
     reader.Dispose();
     if (closeConn)
     {
         db.CloseConnection(conn);
     }
 }
Exemplo n.º 2
0
            /// <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
                }
            }