怎么使用DataTable的select方法来实现多列排序

2025-03-23 18:56:46
推荐回答(1个)
回答1:

DataTable能排序吗?

你可以用DataTable.DefaultView.Sort属性来实现在视图中排序.比如:
private void SortByTwoColumns()
{
// Get the DefaultViewManager of a DataTable.
DataView view = DataTable1.DefaultView;

// By default, the first column sorted ascending.
view.Sort = "State, ZipCode DESC";
}