retrieve more than 5 K record
public static EntityCollection paginationQuery (OrganizationServiceProxy _service, QueryExpression query) { int queryCount = 2500; int pageNumber = 1; int recordCount = 0; query.PageInfo = new PagingInfo(); query.PageInfo.Count = queryCount; query.PageInfo.PageNumber = pageNumber; query.PageInfo.PagingCookie = null; EntityCollection fullResult = new EntityCollection(); while (true) { // Retrieve the page. EntityCollection results = _service.RetrieveMultiple(query); if (results.Entities != null) { // Retrieve all records from the result set. foreach (var rec in results.Entities) { fullResult.Entities.Add(rec); } } // Ch