Quick Delete
I need to clear a list. That is how i do it now : ------- int itemCount2 = listItems2.Count; for (int k = 0; k < itemCount2; k++) { listItems2.Delete(0); } ------- List contains around 5k items. The above algorithm results in deletion speed about 3-5 items a sec. The whole thing teaches me patience quite hard. How can i QUICKLY delete all the items from list ? I think speed is affected by op of putting items in recycle bin. Is it possible to turn off recycle bin for a certain list ?
May 6th, 2010 5:11pm

Can you confirm it's going into the recycle bin? My experience with .Delete is that it's gone permanently. .Recycle sends it to the recycle bin. Also, what is .Delete(0) for? I don't see that in my API, are you using 2010?David Lozzi Delphi Technology Solutions SharePoint Blog | LinkedIn | Twitter ** SharePoint users be aware! The command "stsadm -o uninstall" works, and it doesn't warn you, it simply uninstalls SharePoint! It happened to me!
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2010 3:31pm

Oh, my bad. The above op doesnt delete an list item to recycle bin. That were items deleted in excel view. But still it is slow as ____. ".Delete(0)" is not in API, i made it up myself ) Works both in 2007 & 2010 int itemCount2 = listItems2.Count; for (int k = 0; k < itemCount2; k++) { listItems2.Delete(0); } ... means that it deletes first list item listItems2.Count times How should it be in the right way ?
May 11th, 2010 8:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics