Showing posts with label Working with bulk list items. Show all posts
Showing posts with label Working with bulk list items. Show all posts

Saturday, October 17, 2009

Working with bulk list items

Working with bulk list items

SPWeb.ProcessBatchData Method

Processes the specified batch string of commands for sending multiple requests to the server per transaction.

using (SPWeb oWebsite = SPContext.Current.Site.OpenWeb("Website_URL"))
{
SPList oList = oWebsite.Lists["Announcements"];
System.Guid guid = oList.ID;
string strGuid = guid.ToString();

string strPost = "" +
"" +
"" + strGuid + "" +
"New" +
"Save" +
"" +
"New Manager
" +
"" +
"Congratulations to Mary for her promotion!
" +
"" +
"2003-09-14T00:00:00Z
" +
"
" +
"" +
"" + strGuid + "" +
"New" +
"Save" +
"" +
"New Technical Consultant
" +
"" +
"Welcome to the team, John!
" +
"" +
"2007-10-15T00:00:00Z
" +
"
" +
"
";

string strProcessBatch = oWebsite.ProcessBatchData(strPost);
}