Bind Combobox with a databae Column?
By Wizard i have bind a column of db to Combobox now i want to bind it by programming please guide me using c#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 28, 2013, 2:11 AM
Agree with Alok
only one correction if you use ASP.net application
ComboBox1.DataSource = dt;
ComboBox1.DataValueField = "ID";
ComboBox1.DataTextField = "NAME";
ComboBox1.DataBind();
hope this will help you.
Alok UniyalPosted Jan 28, 2013, 12:10 AM
ComboBox1.DataSource = dt;
ComboBox1.DisplayMember = "Name";
ComboBox1.ValueMember = "ID";
Where 'Name' and 'ID' are columns of Database Table