SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question

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

         <FieldRef Name='BdcIdentity'/>
share|improve this answer

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"];
share|improve this answer

Your Answer


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.