View Single Post
  #4 (permalink)  
Old 11-28-2008, 9:26 PM
cjard's Avatar
cjard cjard is offline
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 65
Posts: 6,442
Reputation: 807
cjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond repute
Default

Quote:
Originally Posted by VBJohney View Post
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
__________________
DW1 DW2 DW3 DW4 DNU PQ
Reply With Quote