1
Reply

ajax

prisilla jayaraj

prisilla jayaraj

Aug 7 2011 1:36 PM
1.4k
i am using ajax update panel in that i place dropdownlist ,my need is i bind the data from database to dropdownlist ,i try it it was working,but when i click the dropdownlist the corresponding item should be display in textbox what is the coding for it?these coding i use it,but it is not working

cn.Open();
da=new SqlDataAdapter("select * from example where no="+DropDownList1.SelectedItem.Text,cn);
da.Fill(dt);
DropDownList1.DataSource = dt;
DropDownList1.DataBind();
cn.Close();
TextBox1.Text = dt.Rows[0][1].ToString();

Answers (1)