I have one custom list which contains appox 10500000 data and it was working fine. but after that it throws timeout error.

so what we did is we trim 20 Lakhs data from that list so list has now 8000000 items. but still it throws timeout error previously it was working with 10000000 data also.

List threshold value is 11000000. Current items in list is 8000000.

we are trying to retrieving data using C# code. Below is the code

SPList list = web.Lists[listName];
SPQuery query = new SPQuery();
query.Query = "<Where><And><In><FieldRef Name='Site' LookupId='TRUE' /><Values><Value Type='Integer'>95</Value><Value Type='Integer'>178</Value><Value Type='Integer'>129</Value><Value Type='Integer'>208</Value><Value Type='Integer'>72</Value><Value Type='Integer'>75</Value><Value Type='Integer'>131</Value><Value Type='Integer'>39</Value><Value Type='Integer'>96</Value><Value Type='Integer'>479</Value><Value Type='Integer'>86</Value><Value Type='Integer'>67</Value><Value Type='Integer'>125</Value><Value Type='Integer'>23</Value><Value Type='Integer'>165</Value><Value Type='Integer'>472</Value><Value Type='Integer'>132</Value><Value Type='Integer'>118</Value><Value Type='Integer'>70</Value><Value Type='Integer'>79</Value><Value Type='Integer'>108</Value><Value Type='Integer'>40</Value><Value Type='Integer'>666</Value><Value Type='Integer'>158</Value><Value Type='Integer'>94</Value><Value Type='Integer'>227</Value><Value Type='Integer'>101</Value><Value Type='Integer'>474</Value><Value Type='Integer'>42</Value><Value Type='Integer'>63</Value><Value Type='Integer'>102</Value></Values></In><Gt><FieldRef Name='Resulted_x0020_Date_x0020_Time' /><Value Type='DateTime'>2017-06-17T19:00:00Z</Value></Gt></And></Where><OrderBy><FieldRef Name='Resulted_x0020_Date_x0020_Time' Ascending='False' /></OrderBy>";
query.ViewFields = "<FieldRef Name=\"ID\"/><FieldRef Name=\"FirstName\"/><FieldRef Name=\"Last_x0020_Name\"/><FieldRef Name=\"Birthday\"/><FieldRef Name=\"Gender\"/><FieldRef Name=\"Resulted Date Time\"/>";
query.RowLimit = 50;
SPListItemCollection myItems = list.GetItems(query);
int count = myItems.Count;
  • try increasing the row limit. however the data is too large and it shouldnt work in SharePoint Commented Nov 16, 2017 at 7:29
  • Already asked here and answered sharepoint.stackexchange.com/questions/20492/… btw that is a rediculous ammount to return. You should do it in batches based on pages so only load and call what is in view ;)
    – Ali Jafer
    Commented Nov 16, 2017 at 7:30
  • tried with pages but same with that also Commented Nov 16, 2017 at 7:40
  • did you tried indexing columns? Commented Nov 20, 2017 at 5:33
  • yes, but not working Commented Nov 21, 2017 at 4:53

1 Answer 1


Since it is on-premises, you can try to increase request timeout in web.config of SharePoint webapplication. Did you tried this?

<httpRuntime executionTimeout="360" /> 

Here 360 is seconds. Change this to 15 minutes=900 and check. Check here more about web.config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.