i am binding the combo box with sql table my code is
public void comboload()
{
SqlConnection conn = new SqlConnection("server=RAOUSMAN-PC;Initial Catalog=usman;User ID=sa;password=123456789");
string query = "select CATEGORYID,CATEGORY from CATEGORY";
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter(query,conn);
DataTable dt = new DataTable();
sda.Fill(dt);
comboBox1.DataSource = dt;
comboBox1.ValueMember ="ID";
comboBox1.DisplayMember = "CATEGORY";
comboBox1.SelectedIndex = 0;
}
kindly guide me where i call this funcation
thanx in advance
...
Go to the complete details ...