This exception is thrown when you try to access an element of a collection with an index that is outside its current bounds.
The IndexOutOfRangeException
is implemented on several platforms and frameworks, though most typically associated with Microsoft's .NET framework.
An IndexOutOfRangeException
is thrown when an attempt is made to access an element of an array with an index that is outside the bounds of the array.
See also Troubleshooting Exceptions: System.IndexOutOfRangeException and What is IndexOutOfRangeException and how do I fix it?