You will need a column with a full name in your data table, because a DataTextField can only refer to one field:
DataTable dt = function_return_Datatable(id); dt.Columns.Add("FullName", typeof(string), "FirstName + ' ' + LastName"); dropdownlist1.DataSource = dt; dropdownlist1.DataTextField = "FullName"; dropdownlist1.DataValueField = "ID"; dropdownlist1.DataBind();
Gotta do it
(you can also add this column to your SQL query)
vc 74 source share