Logo 
Search:

Sharepoint FAQ

Submit Interview FAQ
Home » Interview FAQ » SharepointRSS Feeds

How would you loop using SPList through all SharePont List items, assuming you know the name...

  Shared By: Tarang Nayak    Date: Mar 12    Category: Sharepoint    Views: 1690

Answer:

How would you loop using SPList through all SharePont List items, assuming you know the name (in a string value) of the list you want to iterate through, and already have all the site code written?



Select For Unformatted Code
C#:
1. SPList interviewList = myWeb.Lists["listtoiterate"];
2. foreach (SPListItem interview in interviewList)
3. {
4. // Do Something
5. }

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: