5

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?

1
  • can you post your code?
    – ironman
    Sep 5, 2012 at 13:54

1 Answer 1

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 :)

2
  • This answer uses Linq, but not SPMetal
    – Lzh
    Jul 31, 2014 at 10:29
  • sorry the answer was based on his title, Get SPListItem from LINQ :)
    – Ali Jafer
    Jul 31, 2014 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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