Most of the Developers face the throttling issue while bind and load the data from list to gridview. especially in those scenarios when you have thousands or millions of records in list. in order to protect the performance of the farm as a whole. Limits are applied on a per-Web application basis and are typically managed through the Web application settings in Central Admin. but you can handle the throttling issue while fetching the records from large list, i have tested this code on 10,000 records.
SPWeb web = SPContext.Current.Web; SPList list = web.Lists["yourList"]; SPQuery query = new SPQuery(); query.QueryThrottleMode = SPQueryThrottleOption.Override; SPListItemCollection items = list.GetItems(query);
The SPQueryThrottleOption enumeration has three values: Default, Override, and Strict. If you use the default value, the standard list view threshold applies to all users except local server administrators, who are not bound by either threshold. If you set the query throttle mode to Override, users who have the required permissions in the Web application user policy can query at the higher “auditors and administrators” threshold. Local server administrators remain unbound by either threshold. Finally, if you set the query throttle mode to Strict, this closes down the local server administrator loophole and the standard list view threshold applies to all users.
Hope this Help
Happy SharePointing 😉