.net中的dropdownlist通过一个变量改变选择相同的DataValueField
stringsqlstr="selec...
string sqlstr = "select eid,e_name from EM_Equipment_info "; sqlcon = new SqlConnection(strCon); SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon); DataSet myds = new DataSet(); sqlcon.Open(); myda.Fill(myds, "EM_Equipment_info"); eid.DataSource = myds.Tables["EM_Equipment_info"].DefaultView; eid.DataTextField = "e_name"; eid.DataValueField = "eid"; eid.DataBind(); 下面要做的就是假如我有一个变量eid1如何让dropdownlist控件eid能默认选择其datavaluefield同eid1相同的一项
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询