1

Is it possible to get all items from a single list (getting specific fields) without using a CamlQuery? If I try to use context.Load(oList, ...), I can't use the Include method as the List class doesn't implement the Include method.

I've seen examples that use a ListCollection, but I'm only using one list.

2
  • do you want to get all list items with specific fields? not returning the fields but rather the items themselfs?
    – Ali Jafer
    Mar 12, 2013 at 13:59
  • Yes, the items, but only with certain columns/fields.
    – PeterX
    Mar 13, 2013 at 1:39

1 Answer 1

1

If I'm not wrong you can use empty CamlQuery.

CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<View/>";

For performance issue the common practice is to use view fields to reduce response data.

camlQuery.ViewXml = 
    @"<View>
        <ViewFields>
          <FieldRef Name='PartLookup' LookupId='TRUE' />
          <FieldRef Name='PartLookupSKU' />
          <FieldRef Name='PartLookupTitle' />
          <FieldRef Name='PartLookupDescription' />
          <FieldRef Name='BinNumber' />
          <FieldRef Name='Quantity' />
        </ViewFields>
      </View>";
3

Your Answer

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

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