You might have encountered the error below in Sharepoint thats why you stumbled upon this site.
The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.<nativehr>0x80070024</nativehr><nativestack></nativestack>
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.0x80070024</nativehr><nativestack></nativestack>
Before I give you the solution, lets see why does it happen on the first place so you can better understand what you are fixing. The error basically about the size of the database operation that you are executing in one go, which means it can be viewing a list, loading a page or other database related operations. That error simply says that the number of operations that exceed the limit set on the server this is now treated as an Expensive Query Exception. Now you might notice that your user’s experience this error but not yourself this is because if you are an Administrator then you have higher thresholds.
Now how do you adjust this thresholds. All you have to do is go to Central Administration -> Application Management -> Manage Web Applications then highlight the Name of the site you are adjusting the threshold
Then choose General Settings on the ribbon, then Resource Throttling.
Now you can change your setting on the List View Threshold, by default it is 5000 so you can increase it to something like 10000 to double the operation count. Now you can also see the setting List View Threshold for Auditors and Administrators, that’s the reason why you don’t see the error as it is defaulted to 20000, but if you are an administrator and you have the same issue you can increase both settings.
This should fix your issue now, so go back what you were doing before it happened and it will not throw any exceptions anymore.
Thank you it worked for me
Pingback: How to Archive SharePoint List Items to SQL Server | Raymund Macaalay's Dev Blog