dataview.sorted to datatable issues

MiloCold

Member
Joined
Mar 17, 2005
Messages
21
Programming Experience
Beginner
Hola peoples and peoplettes,

So, I've been reading up on this way to store a sorted dataview in a new datatable, the steps taken below seem to work right (in the datagrid), yet when I start stepping through the sorted datatable the Accts aren't in order. Can someone tell me what gives? Thx

Here's the scene:

VB.NET:
Dim dvSortedAcctNums As DataView = dtUnsortedMess.DefaultView
dvSortedAcctNums.Sort = "Acct_Num"	' Sort By Account Num

' Set sorted view to a new datatable
Dim dtSortedAccts As DataTable = dvSortedAcctNums.Table
dtSortedAccts.TableName = "SortedRecs"

' The output here is sorted properly
gridOUT1.DataSource = dtSortedAccts

'//--> Processing "Supposed" Sorted Recs
...
While CurrentRec < RowCountless1

	rtbOUT1.Text &= _
      dtSortedAccts.Rows(CurrentRec).Item("Acct_Num") & vbCrLf
			
	CurrentRec += 1

End While
That while loop produces a list that is totally not sorted, here's a sample:

MCOLD_1
MCOLD_1
MCOLD_3
MCOLD_2
MCOLD_2
MCOLD_3
MCOLD_3
MCOLD_2
MCOLD_3
MCOLD_3
MCOLD_2
MCOLD_2

I also read about a dataview.ToTable Method but could find one on the instance created, if anyone knows anything about that please give me the 411. Thanks Again for any and all help,

M .Cold
 
Last edited:

MiloCold

Member
Joined
Mar 17, 2005
Messages
21
Programming Experience
Beginner
Hmm...I gave up on correctly storing the sorted dataview into a datatable and just processed the dataview due to time constraints.

Though, I'm still interested in finding a solution that doesn't involve sacrificing a virgin pig to the ADO gods. =o)
 
Top Bottom