关于DropDownList的问题!!!!在线等待!!!
我是用的数据绑定代码如下:
OleDbConnection myconnection = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0;Data Source = "+Server.MapPath("database\\hlxk2003.mdb"));
OleDbDataAdapter dtConn = new OleDbDataAdapter("select * from kq_code_type where retype = '1' ",myconnection);
DataSet dtSet = new DataSet();
dtConn.Fill(dtSet);
DropDownList1.DataSource = dtSet.Tables[0].DefaultView;
DropDownList1.DataBind();
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
Label1.Text = DropDownList2.SelectedItem.Text;
}
为什么不管我选择的是什么,Labl1上显示的都是第一个值呢??