Click here to Skip to main content
15,607,134 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Dear,

I have use one combo box.I have to bind this combo box with data source which have only one column.I am using These coding,but i can't get answer.Kindly give me the solution.

con.Open();
           da = new SqlDataAdapter("select*from operator",con);
           DataTable dt1 = new DataTable();
           da.Fill(dt1);
           cmbOperator.DataSource = dt1;
           //cmbOperator.DisplayMember = "Operator";
           //cmbOperator.ValueMember = "ID";

con.Close();

Thanks&Regards,
Viswanathan.M
Posted
Updated 11-Jun-11 22:03pm
v2

1 solution

You can refer to this:

Populate data from database in a ComboBox[^]

hope this helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900