GeekInterview.com
Series: Subject: Topic:
Question: 68 of 169

How u can create XML file?

Asked by: Interview Candidate | Asked on: Sep 11th, 2005
Showing Answers 1 - 3 of 3 Answers
Harpreet Virk (Pilibangan)

Answered On : Sep 11th, 2005

To write Dataset Contents out to disk as an XML file use:

MyDataset.WriteXML(server.MapPath("MyXMLFile.xml"))

  
Login to rate this answer.
sourabh

Answered On : May 6th, 2006

XmlTextWriter textWriter=new XmlTextWriter("filename.xml"); //WriteStartDocument and WriteEndDocument methods open and close a document for writing textWriter.WriteStartDocument() //write comment textWriter.WriteComment("this is my first xml file.") textWriter.WriteComment("i'm lovin it") textWriter.WriteStartElement("studentDB") //write first element textWriter.WriteStartElement("student") textWriter.WriteStartElement("name",""); textWriter.WriteString("sourabh"); textWriter.WriteEndElement(); textWriter.WriterEndElement(); textWriter.WriteEndDocument(); textWriter.Close(); }

  
Login to rate this answer.

1.Right Click on your project in solution explorer
2.Select XMLfile in "add new itel list" and
3.Click on Add button

Now u will found a XML file in your project

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.