Hi

I have dropdown list in my asp.net page.I wrote a below coing coidng in the SelectedIndexChanged,

protected void cmb_Se_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection  con=new SqlConnection("Data Source=20.1.2.58;Initial Catalog=Customer;User ID=test123");
string str = "select ExecutiveName from  Executive  where TeCode='"+cmb_Te.Text+"'";
con.Open();
SqlCommand command=new SqlCommand(str,con);
SqlDataAdapter adpter=new SqlDataAdapter(command);
DataSet data=new DataSet();
adpter.Fill(data);
int i= data.Tables[0].Rows.Count;
for (int x = 0; i < i; i++)
{


cmb_Se.Items.Add(data.Tables[0].Rows[x].ToString());


}
}

I mention what is code i wrote in my page,But once i select the text from cmb_Te combo box,the below combo box in not change.Pls give me a answer.

Thank you

Edited 3 Years Ago by happygeek: fixed formatting

hi,
u are writing the code in selectchanged event of second combobox as i understand from u r query,so write the code in select changed event of first combobox

HI

Thanks grenny_1984 for ur reply yes i am was wrong .I have to put that in first combo box,then I select post_back(this is wrong property name ,I could not remember name of the property).But now it works

Thanks
Tank 50

Add more infor for Form submit.
AutoPostBack="True"

<asp:DropDownList ID="ddl_Select" runat="server" Width="103px" OnSelectedIndexChanged="ddl_Select_SelectedIndexChanged" OnTextChanged="ddl_Select_TextChanged" [B]AutoPostBack="True"[/B]>
                    </asp:DropDownList>
This question has already been answered. Start a new discussion instead.