Hi Guys
I want to change the values in first combo box1 according to values in combo box2.I wore followign coding but it did nt work.I wrote in under SelectedIndexChanged in combo box
Pls give me idea how to slove this problem
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=IT-TEMP;Initial Catalog=Test;Integrated Security=True");
string str3 = "Select ExecutiveCode from dbo.Executive where TerritoryCode='"+ this.comboBox2.Text +"'";
con.Open();
SqlCommand command3 = new SqlCommand(str3, con);
SqlDataReader reader = command3.ExecuteReader();
comboBox1.Refresh();
while (reader.Read())
{
this.comboBox1.Items.Add(reader[0].ToString());
}
Thanks