I am trying to get a list of items from a specific view. Below is the code
Microsoft.SharePoint.Client.List _lists = context.Web.Lists.GetByTitle("Invoice Register");
context.Load(_lists);
context.ExecuteQuery();
int listCount = _lists.ItemCount; // i get 49000+ count here
View _listsView = _lists.Views.GetByTitle("IT Testing");
context.Load(_listsView);
context.ExecuteQuery();
CamlQuery _query = new CamlQuery();
_query.ViewXml = _listsView.ViewQuery;
Microsoft.SharePoint.Client.ListItemCollection items = _lists.GetItems(_query);
context.Load(items);
context.ExecuteQuery();
int _viewCount = items.Count; // I get nothing here.
The error I get is The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator
I have created indexes already
I have set the limit for "IT Testing" to 5000 as seen here.
If someone can guide, it would be helpful. I have gone through all the links I could.
Regards