The best approach for the above case is to use the ProcessBatchData strong> method of the SPWeb object . This will help you update the list items in the list in batch mode.
- You need to create XML tags that will contain the details for inserting data into the list.
- , , , . , 1000 , 500 .
- XML , StringBuilder.
- Link1 Link2 Link3 ProcessBatchDatastrong >
OM.
`SPWeb Destinationsite = DestinationSiteCollection.OpenWeb();
SPList DestinationList = Destinationsite.Lists[TASKS];
SPListItem DestinationListItem = DestinationList.Items.Add();
foreach (DataRow row in sourceList.Rows)
{
DestinationListItem = DestinationList.Items.Add();
DestinationListItem["Field1"]=row["Col"].ToString();
DestinationListItem["Fieldn"]=row["Coln"].ToString();
DestinationListItem.Update()
}
`