I Have 2 comboboxes in my form.The first combobox1 shoud be fill with the mainproduts which is cmng from database.By selecting The mainproduct the related sub product shoud dispaly in second combobox2.
In form load written this code.....
IM getting In first combobox the Main products values,but In second Combobox System.Data.Dat aRowView is displying insted of related subproducts.
Thanks
In form load written this code.....
Code:
da = new SqlDataAdapter("select * from main_products", con);
da.Fill(ds, "main");
da = new SqlDataAdapter("select * from sub_master", con);
da.Fill(ds, "sub");
comboBox1.DataSource = ds.Tables["main"];
comboBox1.DisplayMember = "prod_name";
comboBox1.ValueMember = "prod_id";
///In combobox selected index changed
DataView dv = new DataView(ds.Tables["sub"]);
dv.RowFilter = "prod_id=" + comboBox1.SelectedValue;
comboBox2.DataSource = dv;
comboBox1.ValueMember = "prod_id";
Thanks
Comment