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?

  • can you post your code? – ironman Sep 5 '12 at 13:54
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 :)

  • 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 Jafer Jul 31 '14 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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