Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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? –  ironman99 Sep 5 '12 at 13:54

1 Answer 1

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 at 10:29
    
sorry the answer was based on his title, Get SPListItem from LINQ :) –  ali Sharepoint Jul 31 at 12:44

Your Answer

 
discard

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.