0

I have created a external content type (BCS list) in SharePoint. I am using the below code in order to get items from bcs list.

SPQuery query = new SPQuery();
query.Query = "<Where><IsNotNull><FieldRef Name='BdcIdentity'/></IsNotNull></Where>";
SPListItemCollection col = list.GetItems(query);

Also I have created a view for the list. Can anyone tell me how to get items from the view of the list?

Thanks

2 Answers 2

1

You could modify the Query Attribute of your View to include your Query, instead of retreiving the elements yourself with the SPQuery

<Query>
  <Where>
     <IsNotNull>
         <FieldRef Name='BdcIdentity'/>
     </IsNotNull>
  </Where>
  <OrderBy>
    <FieldRef Name="SOMEFIELDTOORDERBY"/>
  </OrderBy>
</Query>
0

You can for example use the column name of the list.

Going through the list:

 foreach (SPListItem item in col)
 {
     Object o = item["column name"];
 }

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.