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=;Initial Catalog=Customer;User ID=test123");
string str = "select ExecutiveName from  Executive  where TeCode='"+cmb_Te.Text+"'";
SqlCommand command=new SqlCommand(str,con);
SqlDataAdapter adpter=new SqlDataAdapter(command);
DataSet data=new DataSet();
int i= data.Tables[0].Rows.Count;
for (int x = 0; i < i; i++)



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

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


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

Tank 50

Add more infor for Form submit.

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