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) { item.Delete(); } } }
No comments:
Post a Comment