What is QueryThrottleMode in SPQuery Class?

As per MSDN definition, QueryThrottleMode is a property of SPQuery class which gets or sets value that indicate the throttling mode to be applied to the query.

As we know that List Throttling is a new option available in SharePoint 2010. List Throttling limits the list data that will be fetched in a single request.
Beyond the limit, request will not be allowed.

 ListView Threshold limit can be set through Central Admin and is applicable for web application that will be selected.

QueryThrottleMode property can be used with SPQuery and SPSiteDataQuery  object as shown in below code.

SPList spList = spWeb.Lists[“mylist”];
SPQuery spQuery = new SPQuery(spList .DefaultView);
spQuery.QueryThrottleMode = SPQueryThrottleOption.Override;

QueryThrottleMode has 3 enum values:
Default – 0
Override – 1
Strict – 2

Leave a Comment

RSS
YouTube
YouTube
Instagram