The error message is pretty explicit:
Index was out of range. Must be non-negative and less than the size of the collection, Parameter name : Index
What it is saying is that one of the values you are using to access a collection is either negative, or larger than the number of items in the collection, minus one (as C# indexes are always zero based).
Since your code fragment only accesses the DataRow Cells collection via an index, you need to check the DataTable and see how many columns it has, then find out which index is at fault. Use the debugger: put a breakpoint on the first line of the function and when it is reached, you can look at the variable contents to find the appropriate array index values. Then you can start looking at why the row isn't as big as you think it is...
We can't do that for you: we can't run your code, and don't have access to your data...