mahesh

mahesh

  • NA
  • 116
  • 78k

LINQ to XML

Jul 27 2011 1:42 AM
Dear All,by using Linq,i,m adding some of the nodes to the xml :

 XDocument xdoc = new XDocument(new XDeclaration("1", "utf-8", "yes"),
                                         new XComment("XML data manipulation using Linq"),
                                         new XProcessingInstruction("Instruction", "2333"),
                                         new XElement("Subjects",
                                         new XElement("Subject",
                                         new XElement("Physics", "Good"),
                                         new XElement("maths", "Excellent")
                                         )));
            xdoc.Save(@"C:\data.xml");//in this line it was showing an error that the best overloaded method match for system.xml.linq.xdocument.save(system.xml.xmlwriter) has some invalid arguments.How can i solve this problem?

Thanks in advance.

Answers (5)