Refer below links or Code hope these help.....
Writing the code in Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace BindComboBox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
loadCountry();
}
public void loadCountry()
{
DataTable dt = new DataTable();
try
{
using (SqlConnection con = new SqlConnection("Data Source = testdb;Initial Catalog = ABC;Uid = sa;Password = PassWord123;"))
{
using (SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM country", con))
{
adp.Fill(dt);
comboBox1.DisplayMember = "Country";
comboBox1.ValueMember = "Id";
comboBox1.DataSource = dt;
}
}
}
catch (Exception ex)
{
throw ex;
}
}
}
}
http://www.dotnetsharepoint.com/2013/08/how-to-bind-data-in-combobox-from.html[
^]
http://csharp.net-informations.com/dataset/dataset-combobox.htm[
^]
http://www.aspdotnet-suresh.com/2012/10/showbind-data-to-aspnet-dropdownlist.html[
^]
Happy Coding...