Пример #1
0
 public void Modificar(DVV modificar)
 {
     conexion.Open();
     query = new SqlCommand("UPDATE DVV SET Hash = @hash WHERE Nombre = @nombre", conexion);
     query.Parameters.AddWithValue("nombre", modificar.Nombre);
     query.Parameters.AddWithValue("hash", modificar.Hash);
     query.ExecuteNonQuery();
     conexion.Close();
 }
Пример #2
0
        public DVV GetDVV(DVV buscar)
        {
            conexion.Open();
            DVV dvv = new DVV();

            query = new SqlCommand("SELECT * FROM DVV WHERE Nombre = @nombre", conexion);
            query.Parameters.AddWithValue("nombre", buscar.Nombre);
            using (SqlDataReader reader = query.ExecuteReader())
            {
                while (reader.Read())
                {
                    dvv.Nombre = reader.GetString(0);
                    dvv.Hash   = reader.GetString(1);
                }
            }
            conexion.Close();
            return(dvv);
        }
Пример #3
0
        public List <string> GetTableDVV(DVV buscar)
        {
            conexion.Open();
            List <string> dvhs = new List <string>();

            if (buscar.Nombre == null)
            {
                return(dvhs);
            }
            query = new SqlCommand("SELECT DVH FROM " + buscar.Nombre, conexion);
            using (SqlDataReader reader = query.ExecuteReader())
            {
                while (reader.Read())
                {
                    dvhs.Add(reader.GetString(0));
                }
            }
            conexion.Close();
            return(dvhs);
        }