I need to clear the data contained in a list programmatically.
I know I can iterate through every single item to delete it, but that takes forever.
Any suggestion?
(I'm with the client object model by the way)
Thanks
|
I need to clear the data contained in a list programmatically. I know I can iterate through every single item to delete it, but that takes forever. Any suggestion? (I'm with the client object model by the way) Thanks |
|||
|
|
|
Fastest method is to delete list and then recreate it from scratch trough UI. However in many scenarios this is not possible. If you cannot use server object model to do deletion next best thing is to use Lists.UpdateListItems webservice and preform batch deletion. Take a look at this SO question and accepted answer: How to Delete all the Items from SharePoint List without iteration using SharePoint Webservice |
|||
|
|
|
As I know it allways was a problem to clear SharePoint list. I did it that way - I created a list template from my target list and then I was able to delete list and quickly recreate it again. As I remember it was a quite acceptable solution. But I did it from server side object model. |
|||
|