protected void FillPersonList() { string[] people = sc.GetPeople(); UserDropDownList.DataSource = people; UserDropDownList.DataBind(); ListItem item = new ListItem("Choose User"); UserDropDownList.Items.Insert(0, item); }
private void LoadUser() { string Condition = "WHERE (ISS_BRANCH_INFO.BRANCH_CODE = '" + branchDropDownList.SelectedValue.ToString() + "') "; DataTable dt = oTransactionDAL.GetUser(Condition); UserDropDownList.DataSource = dt; UserDropDownList.DataTextField = "USER_ID"; UserDropDownList.DataValueField = "USER_NAME"; UserDropDownList.DataBind(); }
public void PopulateUserDropDownList1() { con.Open(); cmd = new SqlCommand("select username from users", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); UserDropDownList.DataSource = ds; UserDropDownList.DataTextField = "username"; UserDropDownList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { user_id = Request.QueryString["id"]; //populate shared project grid view and project drop down, user drop down if (!IsPostBack) { LoadShared(); LoadProject(); da1 = new SqlDataAdapter("Select UserId, UserName from Users where UserId != " + user_id, con); dt1 = new DataTable(); da1.Fill(dt1); UserDropDownList.DataSource = dt1; UserDropDownList.DataTextField = "UserName"; UserDropDownList.DataValueField = "UserId"; UserDropDownList.DataBind(); } }