I could decide what to search, but anyway I could not find anything related.
My problem is that I have lets say an array. And I want to create objects but I want the names from the array. I will put this into an example;
XmlElement newSql = xmlDoc.CreateElement(obj.GetType().Name); //scon is a XML element //I am getting the attribute list of the element //pi array takes the attributes of the scon XML element for (int i = 0; i < pi.Length; i++) |
Sam HobbsPosted Jun 21, 2011, 3:24 AM
If you need this to be in C# code, then do you need for there to be a value associated each name? For example, do you need both a property name and a property value?
Perhaps you need to use a C# array or a List or ArrayList or Dictionary or some other collection.
Vishal JadavPosted Jun 20, 2011, 7:52 AM
you have created xmlelement in the loop , but u may have not added it to xmldocument.
Try it ...