且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

排序功能

更新时间:2023-12-06 16:18:52

,ByVal sort_direction
, ByVal sort_direction


)作为DataTable Dim dv作为DataView Dim dt2作为数据表 dt2 = dt.Clone dt2.Merge(dt) dv = dt2.DefaultView dv.Sort = sorttype& "& sort_direction 返回dv.ToTable() 结束功能
) As DataTable Dim dv As DataView Dim dt2 As DataTable dt2 = dt.Clone dt2.Merge(dt) dv = dt2.DefaultView dv.Sort = sorttype & " " & sort_direction Return dv.ToTable() End Function


您可以直接在数据视图中使用数据表"dt".
为什么要摆弄另一个本地作用域表"dt2"?浪费资源和时间!
You could have directly use the datatable ''dt'' with Dataview.
Why toying around with another local scope table ''dt2''? Waste of resources and time!