SPWeb CurrentSite = SPContext.Current.Web;CurrentSite.AllowUnsafeUpdates = true;SPList spList = CurrentSite.Lists["MyList"];StringBuilder sbDelete = new StringBuilder();sbDelete.Append(""); string command = ""; " + spList.ID + "{0} Delete foreach (SPListItem item in spList.Items){sbDelete.Append(string.Format(command, item.ID.ToString()));}sbDelete.Append("");CurrentSite.ProcessBatchData(sbDelete.ToString());
No comments:
Post a Comment