Best Approach for the above case is to Use the ProcessBatchData Method of the SPWeb Object. This will help you to update List items in to the List in Batch.
- You need to build an XML tags that will have details for inserting the data to the list.
- If you have large number of records to be inserted to the list consider spliting it in to smaller batchs. Say if you have 1000 records do it in two 500 sets.
- While building the XML make sure you use StringBuilder class to append the string.
- Refer these Links Link1 Link2 Link3 for more information on ProcessBatchData
In case if you want to do it using the OM. Then follow code
`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()
}
`