IList to XML via a ForEach
Posted on: 12/19/2014 1:43:42 AM | Views : 620

I am trying to find a good example of how to do a ForEach to take a List<Object> and convert it to XML. The reason I want to do a ForEach is because I can do a try/catch on each item and make sure I process all the roads before they fail. This is really coming for a decrypted excel file on the file system, but if I can do it via a List, I think I'll be able to convert it. If it does fail, now with it being a ForEach, I now have the ability to make the XML document no matter what and also log what column fails and what row (ie what person's name it failed on). Then I can check the actual excel file and fix the issue and re-upload just that record. 
Any help would be appreciated. Eventually we are pushing this XML document via a Stored Procedure to SQL server to do the sp_xml parse to insert it into the database. 

Here is how I am currently doing it, but if one thing messes up the entire file does not process etc.

Go to the complete details ...