NET - Explain how to write data to an XML file

Explain how to write data to an XML file.

XmlTextWriter writer = new XmlTextWriter(@"c:\abc.xml", null);

//Write the root element
writer.WriteStartElement("root");

//Write sub-elements
writer.WriteElementString("one", "node1");
writer.WriteElementString("two", "node2");

// end the root element
writer.WriteEndElement();

//Write the XML to file and close the writer
writer.Close();
NET - Explain how XPathNavigator read data from an XMLDocument
Answer - Explain how XPathNavigator read data from an XMLDocument.......
NET - What is an XML Web service?
What is an XML Web service? - XML Web Service is a unit of code that can be accessed independent of platforms and systems.......
NET - What is an XML Web service?
What is an XML Web service? - XML Web Service is a unit of code that can be accessed independent of platforms and systems.....
Post your comment