0

I have reference to a document library. I want to now create a CAML to pull out every item contained within this document library.

I can't seem to figure out the CAML in which to do this. Every CAML I've looked online wants you to give a field reference within the caml.

All I want is all list items present in the doc lib.

Thanks

1

1 Answer 1

0

Found the answer.

If you want to retrieve all list items just don't put anything for the CamlQuery.

private static ListItemCollection GetListItems(List docLibrary, ClientContext ctx)
        {
            CamlQuery query = new CamlQuery();
            var listItems = docLibrary.GetItems(query);
            ctx.Load(listItems);
            ctx.ExecuteQuery();
            return listItems;
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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