Posted on: 6/10/2013 4:40:54 PM | Views : 353

Hi All,
I have the following code:
for (int i = 0; i < list.ChildNodes.Count; i++)
{       if (list.ChildNodes[i].Name.Equals(recordElement))  //for every record in the list do :      {             XmlElement record = (XmlElement)list.ChildNodes[i];             processRecord(record, parentRecordID, currentListID);      } }
I read the XML, if the element name is equal to <RECORD>, I insert a row in the database. The insertion and other process is done in processRecord method where I call x.SaveChanges() to save my changes.
As you see, processRecord method is done in a loop.
I was wondering if I need to use 'TransactionScope' to treat the  'for loop' as a transaction so that if one ...

Go to the complete details ...