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.

  • do you want to get all list items with specific fields? not returning the fields but rather the items themselfs? – Ali Jafer Mar 12 '13 at 13:59
  • Yes, the items, but only with certain columns/fields. – PeterX Mar 13 '13 at 1:39
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>";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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