使用ListItem给DropDownList填充数据
global::日积月累啥的啊.DBhelper db = new 日积月累啥的啊.DBhelper(); ListItem[] item=new ListItem[39]; DataTable dt=db.GetDataTable("select * from Project"); for (int i = 0; i < 39; i++) { item[i] = new ListItem(dt.Rows[i][1].ToString(), dt.Rows[i][0].ToString()); } SelectList1.Items.AddRange(item);