Last week i was working with a list where i have more than 10 lookup fields. By Default sharepoint does not allow more than 8 lookup column to be shown in a view but you can have there columns in the list if not showing in a single view.

In my code, i was reading the 10 people picker value based on a condition using SPQUERY and then copying it to another list.
While accessing 9th lookup column, i got the error “Value does not fall within the expected range”. After investigating the problem I had found that returned list object contains only 8 lookup fields.

You will face this issue for all fields above threshhold value.

Solution:

Earlier I was using

SPListItemCollection coll = configList.GetItems(query);
if (coll.Count > 0)
{
SPListItem confiitem = coll[0];
}

Instead of using SPQUERY returned SPListitem, i used

SPListItemCollection coll = configList.GetItems(query);
if (coll.Count > 0)
{
SPListItem confiitem1 = coll[0];
SPListItem confiitem = configList.GetItemById(confiitem1.ID);
}

Strange but item returned through GetItemById allows you to access lookup column (i.e. People picker column) above threshhold value as well

Hope it will help you….