예제 #1
0
 /// <summary>
 /// Finaliza la conexión establecida
 /// </summary>
 public void CerrarConexion()
 {
     if (conexion.State == ConnectionState.Open)
     {
         conexion.Close();
         conexion.Dispose();
     }
 }
예제 #2
0
        public void Dispose()
        {
            try
            {
                if (Trans != null)
                {
                    Trans.Dispose();
                }
                if (Conn != null)
                {
                    if (Conn.State == System.Data.ConnectionState.Open)
                    {
                        Conn.Close();
                    }

                    Conn.Dispose();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }