I have a datatable in which there are certain columns and rows with values. In addition to this I have a xml template like
this:
<Name></Name>
<Age></Age>
<Phone></Phone>
Now i would like to insert the DataTable column values inside the above tags. i.e. Inside the <name> tag i want to insert to "test", inside the <phone> tag i want to insert phone number. How do i achieve this
Member
3 Points
23 Posts
How to append value inside the xml node
Feb 17, 2014 07:21 AM|vckumareshbabu|LINK
I have a datatable in which there are certain columns and rows with values. In addition to this I have a xml template like this:
<Name></Name>
<Age></Age>
<Phone></Phone>
Now i would like to insert the DataTable column values inside the above tags. i.e. Inside the <name> tag i want to insert to "test", inside the <phone> tag i want to insert phone number. How do i achieve this
Member
403 Points
248 Posts
Re: How to append value inside the xml node
Feb 17, 2014 09:45 AM|shriniwasshukla|LINK
Use Datatable to XML using LINQ.
To do how learn here http://www.codeproject.com/Tips/262910/Data-Tables-to-Formatted-XML-For-loops-vs-LINQ-to
Star
12777 Points
1635 Posts
Re: How to append value inside the xml node
Feb 18, 2014 02:46 AM|Terry Guo - MSFT|LINK
Hi vckumareshbabu,
Based on your code, my understanding is that you would like to modify the node value and then save the value in xml file.
If so, please try to refer the following code:
Hope it helps.
Best Regards,
Terry Guo