对每个Dropownlist都
SqlCommand cmd=new SqlCommand("select id,name from yourtable",con);
SqlDataReader dataReader=cmd.ExecuteReader();
DropDownList1.DataSource=dataReader;
DropDownList1.DataTextField="name";
DropDwonList1.DataValueField="id";
DropDwonList1.DataBind();
con.Close();
吗????
SqlCommand cmd=new SqlCommand("select id,name from yourtable",con);
SqlDataReader dataReader=cmd.ExecuteReader();
DropDownList1.DataSource=dataReader;
DropDownList1.DataTextField="name";
DropDwonList1.DataValueField="id";
DropDwonList1.DataBind();
con.Close();
吗????
SqlCommand cmd=new SqlCommand("select id,name from yourtable",con);
SqlDataReader dataReader=cmd.ExecuteReader();
DropDownList1.DataSource=dataReader;
DropDownList1.DataTextField="name";
DropDwonList1.DataValueField="id";
DropDwonList1.DataBind();
con.Close();
显然很不好了.但是我想不到其他什么办法啊