How would I populate a DropDownList's value and text fields with information in a DataTable?
asp.net, datatable, drop-down-menu, vb.net
Solution
EmployeeDropDownList.DataSource=Employees.DefaultView
EmployeeDropDownList.DataTextField = "Name"
EmployeeDropDownList.DataValueField = "EmployeeID"
EmployeeDropDownList.DataBind()
Problem
How would I populate a `DropDownList's` value and text fields with information in a DataTable? Example DataTable ``` Employees : EmployeeID, Name ``` I tried... ``` EmployeeDropDownList.DataTextField = Employees.NameColumn EmployeeDropDownList.DataValueField = Employees.EmployeeIDColumn EmployeeDropDownList.DataBind() ``` The two assignment lines are invalid though because it's not the correct datatype.