发布网友 发布时间:2022-04-10 09:16
共3个回答
懂视网 时间:2022-04-10 13:37
//获得学科列表
DataTable xiaoXueke = My_Sql.Sql5("select X_SN,X_DaiMa,X_Name from NongCun_XueKe");
this.Drop_XueKe.DataSource = xiaoXueke;
this.Drop_XueKe.DataTextField = "X_Name";
this.Drop_XueKe.DataValueField = "X_DaiMa";
this.Drop_XueKe.DataBind();
DataRow[] _XueKe = xiaoXueke.Select();
for (int i = 0; i < _XueKe.Length;i++ )
{
this.Drop_XueKe.Items.Add(new ListItem("学科:"+_XueKe[i]["X_name"].ToString(),_XueKe[i]["X_DaiMa"].ToString()));
}
数据库查找数据绑定到DropList上
标签:ring add sel daima .sql ima 数据 row bind
热心网友 时间:2022-04-10 10:45
DropDownList1的绑定数据热心网友 时间:2022-04-10 12:03
一楼的回答正确!