vb.net dataset datatable 重排序
[size=12px]dataset中有两张datatable表,两张表有一个字段是关联的,我想让第二张表的顺序可以照应着第一张表的顺序,就是两张表的信息可以对应起来,请问这有什么办法可以解决吗?[/size]
...全文
请发表友善的回复…
发表回复
新鲜鱼排 2007-12-07
- 打赏
- 举报
Dataset中Table1有一列Col1,Table2有Col1和Col2(如果没有Col1的话可以添加这一列)。然后使用DataView,对你需要的字段进行排序。
http://msdn2.microsoft.com/en-us/library/system.data.dataview.sort.aspx
Private Sub SortByTwoColumns()
' Get the DefaultViewManager of a DataTable.
Dim view As DataView = DataTable1.DefaultView
' By default, the first column sorted ascending.
view.Sort = "State, ZipCode DESC"
End Sub
http://msdn2.microsoft.com/en-us/library/system.data.dataview.sort.aspx
Private Sub SortByTwoColumns()
' Get the DefaultViewManager of a DataTable.
Dim view As DataView = DataTable1.DefaultView
' By default, the first column sorted ascending.
view.Sort = "State, ZipCode DESC"
End Sub