示例#1
0
        private void categorie_box_SelectedIndexChanged(object sender, EventArgs e)
        {
            string nom_categorie = categorie_box.SelectedItem.ToString();

            db.cmd = new SqlCommand("SELECT * FROM Categorie where nom_categorie = '" + nom_categorie + "'", db.conn);
            SqlDataAdapter da = new SqlDataAdapter(db.cmd);
            DataTable      dt = new DataTable();

            da.Fill(dt);
            if (dt.Rows.Count == 1)
            {
                db.Fill_Plat_ParCategorie(plat_box, dt.Rows[0].Field <int>("id_categorie"));
            }
        }