Linq to xml not able to add new elements
- by Fore
We save our xml in a "text" field in the database. So first I check if it exist any xml, if not I create a new xdocument, fill it with the necessary xml. else i just add the new element. Code looks like this:
XDocument doc = null;
if (item.xmlString == null || item.xmlString == "")
{
doc = new XDocument(new…