Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > xmlfile
 

xmlfile

Hi,
xmlw = new XmlTextWriter("c:\\testing.xml",null);
xmlw.WriteStartDocument();
xmlw.WriteStartElement("Company");
xmlw.WriteStartElement("Software");
xmlw.WriteStartElement("Skills");
xmlw.WriteElementString("Microsoft", textBox1.Text);
xmlw.WriteElementString("Sun", textBox2.Text);
xmlw.WriteEndElement();
xmlw.WriteStartElement("Management");
xmlw.WriteElementString("Admin", textBox3.Text);
xmlw.WriteElementString("Assist", textBox4.Text);
xmlw.WriteEndElement();
xmlw.WriteEndElement();
xmlw.WriteEndElement();
xmlw.WriteEndDocument();
xmlw.Close();

The above code is for creating an xml, its working fine now iam having two requirements based on above code
1)after writing (xmlw.Close()) xml i want to display that xml in text box
2) I want to add multiple records in that xmlfile bcoz it creatinng only one record then we added another record means its replacing the previous record
I want to add multiple records in xml how?

Santhosh22  Thursday, July 17, 2008 6:34 AM
  1. answered here
  2. use theXmlDocument class to append the xml file and write another element. see this article too.
Lucian Baciu  Thursday, July 17, 2008 8:28 AM
  1. answered here
  2. use theXmlDocument class to append the xml file and write another element. see this article too.
Lucian Baciu  Thursday, July 17, 2008 8:28 AM

You can use google to search for other answers

Custom Search

More Threads

• When will the next version of terrarium be released?
• Creating A New User
• New 1.1 version?
• server side config
• Error Trying to Install Issue Vision
• PocketVision Errors
• Terrarium Challenge
• trying to replicate "historyList" functionality
• Improve mutations, please!
• Is it possible to use the PhotoListView outside of this application?