Quote:
Originally Posted by VBJohney
Looks like you are continuing to use the variable sortedList to hold the sorted list without clearing it out.
put in the line
sortedList = String.Empty before the for loop.
|
Should work, BUT.. I have a problem with his original code, actually.. the entire post reads like he wants to alter the sort order of a comma separated list of values stored in a single db field, but the placement of the arraylist adds INSIDE the for loop means that:
1:USA,BEL,DEU,CAN
Will become 4 records:
1:BEL,
1:BEL,CAN,
1:BEL,CAN,DEU,
1:BEL,CAN,DEU,USA
Thus 4 database updates will be done, 3 of them pointless. My version of the code doesnt perform these meaningless database operations