K
Keith G Hicks
I'm not great at vb.net and I don't particularly like arrays so I use them
as little as possible. I tend to think in terms of VBA or even old clunky
xBase ideas when I do things like this and I know there are some great
features in vb.net that make this sort of thing easier than I'm probably
making it. I'm kind of stumblign around on this issue. If there's a better
way to handle this then feel free to let me know.
I have a 2 dimensional array. I'm storing ID #'s of database rows in one
column and the # of times an insert is attempted in another column. I need
to get the first column into a column delimited string. How can I do that?
Dim aNoticeIDsThatAreBad(1, 0) as Int32
aNoticeIDsThatAreBad(0, 0) = 123456
aNoticeIDsThatAreBad(1, 0) = 1
ReDim Preserve aNoticeIDsThatAreBad(1, 1)
aNoticeIDsThatAreBad(0, 1) = 123457
aNoticeIDsThatAreBad(1, 1) = 2
ReDim Preserve aNoticeIDsThatAreBad(1, 2)
aNoticeIDsThatAreBad(0, 2) = 123458
aNoticeIDsThatAreBad(1, 2) = 1
I need to get a string like this "123456,123457,123458".
Is there a function that can do this or do I have to loop through the array
and build it?
In addition to the above, I need to do a few other things with this array.
1. I need to look up NoticeID's in the array and see if they are in there
and if so, what is the related insertion attempt #.
2. If the insertion attempt fails, then I need to increment the # of
insertion attempts.
3. I also need to remove items from the array if an attempt made on that
item succeeds.
Any kind help would be greatly appreciated.
Thanks,
Keith
as little as possible. I tend to think in terms of VBA or even old clunky
xBase ideas when I do things like this and I know there are some great
features in vb.net that make this sort of thing easier than I'm probably
making it. I'm kind of stumblign around on this issue. If there's a better
way to handle this then feel free to let me know.
I have a 2 dimensional array. I'm storing ID #'s of database rows in one
column and the # of times an insert is attempted in another column. I need
to get the first column into a column delimited string. How can I do that?
Dim aNoticeIDsThatAreBad(1, 0) as Int32
aNoticeIDsThatAreBad(0, 0) = 123456
aNoticeIDsThatAreBad(1, 0) = 1
ReDim Preserve aNoticeIDsThatAreBad(1, 1)
aNoticeIDsThatAreBad(0, 1) = 123457
aNoticeIDsThatAreBad(1, 1) = 2
ReDim Preserve aNoticeIDsThatAreBad(1, 2)
aNoticeIDsThatAreBad(0, 2) = 123458
aNoticeIDsThatAreBad(1, 2) = 1
I need to get a string like this "123456,123457,123458".
Is there a function that can do this or do I have to loop through the array
and build it?
In addition to the above, I need to do a few other things with this array.
1. I need to look up NoticeID's in the array and see if they are in there
and if so, what is the related insertion attempt #.
2. If the insertion attempt fails, then I need to increment the # of
insertion attempts.
3. I also need to remove items from the array if an attempt made on that
item succeeds.
Any kind help would be greatly appreciated.
Thanks,
Keith