Hello All,

Can any one tell me how we bind data to a ComboBox from a dataset?

Thanks for your precious help

For binding a ComboBox we have to set its display as well as value member. :)

//Your Code for connecting to database and retrieving data in dataset1
//You have two columns in dataSet1.Tables[0] ,, "id", "name"


//Rest of the code

Thanks for your reply... Saikalyankumar The link you provided is not opening... abelLazm Thanks for your help, how to add items in comboBox after binding?

.....how to add items in comboBox after binding?

dear bahed after adding these lines you data will automatically populate in combobox there is no need to add any thing like combobox.items.add();

U, can loop through each row in the Table of the Dataset and by using the combobox.items.add, u can add the items. an ex: code is here

for (int i = 0; i < dt.Rows.Count - 1; i++)
                    DataRow dr = dt.Rows[i];

Thanks abellazm your post really worked for me...Saikalyankumar your provided link is also very useful thanks again