Tuesday, 8 March 2016

Fill Combobox From DatBase In c#


            MySqlCommand cmd = new MySqlCommand("select * from tbl_categorie", con.getcon());
            MySqlDataAdapter da = new MySqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);
            cmb_categorie.DataSource = dt;
            cmb_categorie.ValueMember = "Ctegory_Id";
            cmb_categorie.DisplayMember = "categorie";
            

No comments:

Post a Comment