怎样实现把表中的一个字段的值绑定到dropdownlist,并通过选择来选取?
一定要用ArrayList吗?
可以直接用DataReader,比如
SqlConnection con=new SqlConnection("...");
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();