I am trying to pull in multiple sections from a configuration file. I thought that GetConfigNode("MyObject"); would pull in all sections with that as the type. I am working on enhancing the current application, which previously all had distinct types. However I need to have the same type for the new section I need to add and it also needs to be a completely new section (with the ProcessName being different). Right now if I run this, only one section gets pulled into the list and I am not sure how to grab any sections with the same name into a list to then iterate over.
I have a config file that holds some mapping information:
<Upload ProcessName="ObjectName1" Type="MyObject"> <FieldMapping SourceField="Name" DestinationField="Name1"/> </Upload> <Upload ProcessName="ObjectName2" Type="MyObject"> <FieldMapping SourceField="Address" DestinationField="Address1"/> </Upload> Code behind:
private static bool Upload() { List<UploadElement> UpEle = GetConfigNode("MyObject"); // rest of code }
No comments:
Post a Comment