Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. var newObjClientContext = this.GetSharePointClientContext(accessToken, fullUri);
  2. WebCollection collWeb = newObjClientContext.Web.GetSubwebsForCurrentUser(new SubwebQuery());
  3. var documentLibrary = newObjClientContext.Web.Lists.GetById(docID);
  4.  
  5. ListItemCollectionPosition itemPosition = new ListItemCollectionPosition();
  6. itemPosition.PagingInfo = string.Format("Paged=TRUE&p_ID={0}", iSkip); //Skip thingy doesn't work with Order By
  7.  
  8. ListItemCollection ltitems = null;
  9.  
  10. string vquery = @"<View >
  11. <Query>
  12. <Where>
  13. <Or>
  14. <Eq>
  15. <FieldRef Name='FSObjType' />
  16. <Value Type='Lookup'>1</Value>
  17. </Eq>
  18. <Eq>
  19. <FieldRef Name='FSObjType' />
  20. <Value Type='Lookup'>0</Value>
  21. </Eq>
  22. </Or>
  23. </Where>
  24. <OrderBy><FieldRef Name='FileLeafRef' Ascending='TRUE'></FieldRef></OrderBy>
  25. </Query>
  26. <RowLimit>" + recCount + @"</RowLimit>
  27. </View>";
  28.  
  29. CamlQuery camlQuery = new CamlQuery();
  30. camlQuery.ListItemCollectionPosition = itemPosition; //This is ignored.
  31. camlQuery.ViewXml = vquery;
  32. ltitems = documentLibrary.GetItems(camlQuery);
  33. newObjClientContext.Load(documentLibrary);
  34. newObjClientContext.Load(ltitems, lists => lists.IncludeWithDefaultProperties(l => l.ParentList));
  35.  
  36. newObjClientContext.ExecuteQuery();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement