string id;//选择的角色id protected void Page_Load(object sender, EventArgs e) { id = Request["a"]; try { con.Open(); SqlCommand com = new SqlCommand("select RoleName from Role", con);//给管理员选择角色 com.ExecuteNonQuery(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(com); da.Fill(ds); RoleType.DataSource = ds; RoleType.DataTextField = "rolename"; RoleType.DataBind(); } catch { } finally { con.Close(); } }