SharePoint for Developers: 3.2 Hands-on - getting list items

To read data from list we have to get reference to list first. SPWeb has lists collection we can use to find the list we are interested in. Following code example shows how to get instance of list.


NB! This blog is moved to

Click here to go to article


  • Thank you, Vince, for your reply. I will handle querying in the next entry of this serie. Also I will there that querying is normal way to get data and why it is good plan to avoid using full size item collections.

  • I agree with Vince. Using SPQuery/CAML is the correct way of getting items from a list, your code might look a bit overkill - but the performance increase is overwhelming.
    We recently ran into performance trouble, which was not present during the test phase, and the reason was that one of our list which we foreached over had grown to about four times it's size - a quick switch to a simple CAML question solved it, and even made it perform better than ever.

  • Lets say that items 1,2 are returned. On the website, when you click item 1, it opens up another page with the item details. How do we get to the details once we have the list ?

  • Hi ,
    i want copy list items to share point library .both list & Lib same site .pls send me code

Comments have been disabled for this content.