在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
………………………………………… DataSet ds= new DataSet(); ds = cls2.SelectOle(); DropDownList1.DataSource = ds.Tables["My"].DefaultView; DropDownList1.DataTextField = "dep_Name"; DropDownList1.DataValueField = "dep_Id"; DropDownList1.DataBind(); 第二种: DataSet set1= new DataSet(); set1 = cls2.SelectOle(); for (int num1 = 0; num1 < set1.Tables["My"].Rows.Count; num1++) { DropDownList1.Items.Add(set1.Tables["My"].Rows[num1][1].ToString()); } <asp:DropDownList ></asp:DropDownList> |
请发表评论