I have a datatable with one column that contain names.I want to load combobox with datatable such that names should be in alphabetic order for eg:first name starts with a. s
Method 1
// orderby "FistName" column
EnumerableRowCollection query =
from order in datatable.AsEnumerable()
orderby datatable.Field("FirstName")
select datatable;
DataView view = query.AsDataView();
// bind to your combobox
combobox.DataSource = view;
combobox.DataBind()
Method 2: if using DataSets
DataTable datatable = dataSet.Tables["yourDataTable"];
DataView view = datatable .AsDataView();
view.Sort = "FirstName desc, LastName desc";
combobox.DataSource = view;
combobox.DataBind();
Reference : Sorting with DataView (LINQ to DataSet)