I would say the problem here is that you are referencing an incremental index some the columnds of the table which you don't need to do. Basically it plays out like this:
If your string collection looks like this:
"one"
"two"
"three"
And your new datatable structure looks like this
Accounts
--------
then what that loop is trying to do is this:
Code:
What you want: What you are getting:
Accounts Accounts
-------- --------
"one" "one"
"two" "two"
"three" "three"
Every column assignment after the first one is trying to assign to a non-existing column. You don't need to index the Items of the row, just use the first one (which is the first and only column you added to the table):
myRow.Item(0) = strCollection(counter)
-
Peter