August 2010
2 posts
5 tags
One of the most elementary mistakes that I have seen fellow coders make, in .NET anyway, is trying to loop through data within objects using a count of rows/columns. The row number of the datarows does not start at the same number as the start of the loop through a reflection of .Count.
If you are looping through a set of datarows it will start at 0, as objects are zero-based indexed.
If you...
4 tags
Here’s some delightful error handling…
Catch oor As ArgumentOutOfRangeException
‘Try going back one? *shrug*
i = i -1
Yup, if the loop has gone too far but still has stuff to process, just … go back and do the last one again :)