Where is your code? :((
My guesses here
Is any loop in your coding?
I think you are running the loop from 0 to the count. Try Count - 1, because the count is > last index.
Example:
for (int i = 0; i < dt.Rows.Count; i++)
{
}
It should be
for (int i = 0; i < dt.Rows.Count - 1; i++)
{
}
Is any array in your coding?
Check the index because it should be based on array size
Example:
ArrayList alTest = new ArrayList(2);
alTest[0] = "0";
alTest[1] = "1";
alTest[2] = "2";
Please include your code in your question from next time. :((