SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 used SPMetal to create a data context. I can query my lists. The queries return an object of the type of list that they are in. Is it possible to convert this type into a normal SPListItem object?

share|improve this question
can you post your code? – ironman Sep 5 '12 at 13:54

i think you can call it directly if im correct:

List<SPListItem> items = (from l in list.Items.OfType<SPListItem>() where l["KPI Status"] != null && Convert.ToInt32(l["KPI Status"]) == 1 select l).ToList<SPListItem>();

hope this helps :)

share|improve this answer
This answer uses Linq, but not SPMetal – Mzn Jul 31 '14 at 10:29
sorry the answer was based on his title, Get SPListItem from LINQ :) – ali Sharepoint Jul 31 '14 at 12:44

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.