Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 21, 2005 06:21 PM by sconard
Member
605 Points
151 Posts
Jul 21, 2005 06:21 PM|LINK
Seems like 101 but its stumping me. I create a dataset using merge Dim dtTemp As DataTable Dim dsTemp As New DataSet dtTemp = NewTableFromFunction If dsSearch.Tables.Count > 0 Then dsTemp.Tables.Add(dtTemp) dsSearch.Merge(dsTemp) dsSearch.AcceptChanges()
Else dsSearch.Tables.Add(dtTemp) End If Then attempt to sort using microsoft method (Name of the table is Files and name of the col is FileName) Dim dv As New DataView Dim dvm As New DataViewManager(dsSearch) Dim dvs As DataViewSetting
For Each dvs In dvm.DataViewSettings dvs.ApplyDefaultSort = True Next dvm.DataViewSettings("Files").Sort = "FileName"
dgFileList.DataSource = dvm.DataSet dgFileList.DataBind() When bound to datagrid the results are not sorted by "FileName" My guess is the objects are never truely "merged" Any help appreciated
sconard
Member
605 Points
151 Posts
sort dataset
Jul 21, 2005 06:21 PM|LINK
Seems like 101 but its stumping me.
I create a dataset using merge
Dim dtTemp As DataTable
Dim dsTemp As New DataSet
dtTemp = NewTableFromFunction
If dsSearch.Tables.Count > 0 Then
dsTemp.Tables.Add(dtTemp)
dsSearch.Merge(dsTemp)
dsSearch.AcceptChanges()
Else
dsSearch.Tables.Add(dtTemp)
End If
Then attempt to sort using microsoft method (Name of the table is Files and name of the col is FileName)
Dim dv As New DataView
Dim dvm As New DataViewManager(dsSearch)
Dim dvs As DataViewSetting
For Each dvs In dvm.DataViewSettings
dvs.ApplyDefaultSort = True
Next
dvm.DataViewSettings("Files").Sort = "FileName"
dgFileList.DataSource = dvm.DataSet
dgFileList.DataBind()
When bound to datagrid the results are not sorted by "FileName"
My guess is the objects are never truely "merged"
Any help appreciated