DropDownList1.DataSource = dt; DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "ID"; DropDownList1.DataBind();
//clsUser is my own defined class with the UserSelect method clsUser objUsers = new clsUser(); DataTable dtUser = objUsers.UserSelect("Select * from Users"); //take a combobox in front end or in codebehind ComboBox cmb = new ComboBox(); cmb.DropDownStyle = ComboBoxStyle.DropDownList; //set the datasource cmb.DataSource = dtUser.Copy();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)