Collection to XML
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-11-22 09:18 AM
Hi, I'd like to convert a flat collection like this:
First_Name Last_Name Age
John Smith 78
Lisa McDonald 24
into XML like this:
<root>
<person>
<First_Name>John</First_Name>
<Last_Name>Smith</Last_Name>
<Age>78</Age>
</person>
<person>
<First_Name>Lisa</First_Name>
<Last_Name>McDonald</Last_Name>
<Age>24</Age>
</person>
</root>
Indentation is not a must but any extra attributes (eg. from serialization) are not desired.Thank you
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-11-22 10:16 AM
I consider using DataSet.GetXml().
If you have better way, feel free to share it!
If you have better way, feel free to share it!
