I don't know if this works...

Put a breakpoint on while and see if it loops more than one time.
If it does, put a Count = Count+1 before the GetValue and then change s = x.GetValue(0), to s = x.GetValue(count)

NOT TESTED! See for yourself.