Control OBJECTS:
1. FORM : name = form1.
2.COMBOBOX:name = combobox1.
3. DATAGRID: name = datagridview1.
private void Form1_Load(object sender, EventArgs e)
{
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=Northwind;Integrated Security=True");
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("select *from products", cn);
da.Fill(ds,"products");
da.SelectCommand.CommandText = "select distinct product name from products";
dataGridView1.DataSource = ds.Tables["PRODUCTS"];
comboBox1.DataSource = ds.Tables["PRODUCTS"];
comboBox1.DisplayMember = "PRODUCTNAME";
comboBox1.ValueMember = "PRODUCTID";
comboBox1.SelectedIndex = 2; //Show product name in a combobox at index 2 when form load.
}