Click here to Skip to main content
16,008,750 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there I want yo populate my combo box with data from ms access
Posted
Comments
Kornfeld Eliyahu Peter 25-Jan-14 15:15pm    
Try Google - there are a lot of answers...

1 solution

Please Try to use Google.

Sample Coding:
C#
SqlConnection scon = new SqlConnection("your connection string");
           scon.Open();
           DataTable dt = new DataTable();
           string query = "Select ColumnName from TableName";
           SqlCommand cmd = new SqlCommand(query, scon);
           SqlDataAdapter sda = new SqlDataAdapter(cmd);
           sda.Fill(dt);
           scon.Close();
           yourComboboxName.DisplayMember = "ColumnName";
           yourComboboxName.DataSource = dt;
 
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