I am " trying " to figure out how to create a Windows Phone 7 application , and I would like to update / save the xml file with the following function:
XDocument xmlDoc = XDocument.Load("myApp.xml"); xmlDoc.Element("ocd").Add(new XElement("vDetails", new XElement("itemName", this.tb_Name.Text), new XElement("Date", System.DateTime.Now.ToString()), new XElement("itemValue", ""))); xmlDoc.Save("data.xml");
However, the xmlDoc.Save line gives an error: the best overloaded method match for "System.Xml.Linq.XDocument.Save (System.Xml.XmlWriter) has several invalid arguments.
What do I need to do to fix this?
source share