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 count the number of datarows then want to loop through them all, it will count them as you and I would, starting from 1.
So, if you are looping through a set of datarows and want to get through them all, from the beginning to the number of rows you must loop from 0 to the number of rows minus 1 (- 1) or else you will get an ArgumentOutOfRangeException because it tries to find columns 1, 2, 3 in the dataset instead of 0, 1, 2.