Wednesday, 23 April 2014

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator
Root Cause:
Go to list -->List Settings:
List view threshold.
6000 items (list view threshold is 5000).
if u see above message then you will get error while running below code...
Mycontext.Load(MyListitemCollection);
Mycontext.ExecuteQuery();
Solution:
In the list settings:
Click on : Indexed columns
Click on: Create a new index
from Primary column for this index:
Select Title
Click Create
Now in the camel query change ViewXml
Now try to run

OR

1. Navigate to Central Administration.
2. Go to Application Management > Manage Web Application and click on your web application to select it.
3. In the Ribbon, click on General Settings drop-down and choose “Resource Throttling”.
4. In the “List View Threshold”, increase the value (by a factor of 2, for example) and click OK.
5. Try to replicate the error. If the error persists, increase the value again until the error goes away.