📅  最后修改于: 2022-03-11 14:48:54.481000             🧑  作者: Mango
cmd.CommandText = " Select * From GetUsersID";
cmd.Connection = conn;
conn.Open();
DataTable dt = new DataTable();
dt.Load(cmd.ExecuteReader());
conn.Close();
DropDownList1.DataSource = dt;
DropDownList1.DataTextField = "Name";
DropDownList1.DataValueField = "ID";
DropDownList1.DataBind();