public bool CrearInstrumento(ENInstrumento ins)
        {
            conexion = "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\Database1.mdf;User Instance=true";
            SqlConnection sq_con = new SqlConnection(conexion);

            try
            {
                sq_con.Open();
                SqlCommand instrumento = new SqlCommand("INSERT INTO INSTRUMENTO(NOMBRE,TIPO,TIPO_PROD,PRECIO,ID) VALUES ('" + ins.Nombre + "','" + ins.Tipo + "','" + ins.Tipo_prod + "','" + ins.Precio + "'," + ins.Id + ")", sq_con);
                instrumento.ExecuteNonQuery();
                return true;
            }
            catch (Exception ex) { }
            finally { sq_con.Close(); }

            return false;
        }
        public void ActualizaInstrumento(ENInstrumento instrumentoActualizado)
        {
            conexion = "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\Database1.mdf;User Instance=true";
             SqlConnection sq_con = new SqlConnection(conexion);
             try
             {
                 sq_con.Open();
                 SqlCommand instrumentos = new SqlCommand("update instrumentos set nombre = instrumentoActualizado.nombre", sq_con);
                 instrumentos = new SqlCommand("update instrumentos set tipo = instrumentoActualizado.tipo", sq_con);
                 instrumentos = new SqlCommand("update instrumentos set tipo_prod = instrumentoActualizado.tipo_prod", sq_con);
                 instrumentos = new SqlCommand("update instrumentos set precio = instrumentoActualizado.precio", sq_con);
                 instrumentos = new SqlCommand("update instrumentos set id = instrumentoActualizado.id", sq_con);

             }

             catch (Exception ex) { }
             finally { sq_con.Close(); }
        }
        public ArrayList ListarInstrumentos()
        {
            conexion = "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\Database1.mdf;User Instance=true";
            SqlConnection sq_con = new SqlConnection(conexion);
            sq_con.Open();
            SqlCommand instrumento = new SqlCommand("select * from INSTRUMENTO", sq_con);
            SqlDataReader dr = instrumento.ExecuteReader();
            while (dr.Read())
            {
                ENInstrumento readIns = new ENInstrumento();

                readIns.Nombre = dr["NOMBRE"].ToString();
                readIns.Tipo = dr["TIPO"].ToString();
                readIns.Tipo_prod = dr["TIPO_PROD"].ToString();
                readIns.Precio = dr["PRECIO"].ToString();
                readIns.Id = Convert.ToInt32(dr["ID"]);

                lista.Add(readIns);
            }
            sq_con.Close();
            return lista;
        }