hello
i my window form i have combo box and i bind with sql server
the combobox bind like this
combobox1.datasource=dt;
combobox1.valuemember="id";
combobox1.displaymember="name";
now when i select tha name in combobox how i get the id of selected name
plz help me
How to get combobox value in windwoform
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Dorababu MekaRank #457 · 5.5K reputationPosted Jun 8, 2011, 2:10 AM EDT
DisplayMember
ValueMember
DataSource
And you can get the selected value by using combobox1.SelectedValue to get the value