Ex. You have a list named "Sample List"
using (SPSite siteCollection = new SPSite("http://server")) { using (SPWeb site = siteCollection.OpenWeb()) { SPList list = site.Lists["Sample List"]; foreach (SPListItem item in list.Items) { //do what you want to do with it. } } }
No comments:
Post a Comment