Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to retrieve only the documents that are present inside a specific folder of a document library using GetListItemsAsync method.

Here is how i call it:

sc.GetListItemsAsync("MyDocLib", null, null, null, null, 
    XElement.Parse(@"<QueryOptions><Folder>MyFolder</Folder></QueryOptions>"),
    null);

The call is returning all the documents inside "MyDocLib" and not only those that are in "MyFolder".

How can I do that?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You can try this

sc.GetListItemsAsync("MyDocLib", null, null, null, null, 
    XElement.Parse(@"<QueryOptions><Folder>MyDocLib/MyFolder</Folder></QueryOptions>"),
    null);

Notice the document library name before the folder name.

Hope this helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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