Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i have write a xml file from dataset values ,Now i need to add a row or tag to that xml file...


Thanks,
Posted
Updated 29-Mar-12 15:40pm
v4
Comments
RDBurmon 29-Mar-12 8:36am    
Could you elaborate with some example of XML and change in XML ?
[no name] 29-Mar-12 21:41pm    
Edited content

1 solution

If you convert the xml file to an XDocument http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument.aspx[^], then you can add and remove nodes.

XML
string str =
@"<?xml version=""1.0""?>
<!-- comment at the root level -->
<Root>
    <Child>Content</Child>
</Root>";
XDocument doc = XDocument.Parse(str);
Console.WriteLine(doc);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900