Sort items in datatable

后端 未结 5 762
臣服心动
臣服心动 2020-12-19 12:01

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

5条回答
  •  粉色の甜心
    2020-12-19 13:05

    Here's the answer that you're looking for.

    DataTable MyDataTable;
    const string SortByClause = "[SomeCol] ASC";
    MyDataTable.DefaultView.Sort = SortByClause ;
    

提交回复
热议问题