Hi Guys
Well the problem is like this i have the following code
XmlTextWriter writer = new XmlTextWriter("D:\\Grop.xml", System.Text.Encoding.UTF8);
writer.WriteStartDocument(true);
writer.Formatting = Formatting.Indented;
writer.Indentation = 2;
writer.WriteStartElement("Table");
createNode("123", "3232", "43234","A string of text 1",DateTime.Now.ToString(), writer);
createNode("123", "3232", "43234", "A string of text 2", DateTime.Now.ToString(), writer);
createNode("123", "3232", "43234", "A string of text 3", DateTime.Now.ToString(), writer);
createNode("123", "3232", "43234", "A string of text 4", DateTime.Now.ToString(), writer);
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
//the create node method
private void createNode(string stud_Id, string post_Id, string group_Id,string desc, string postdate, XmlTextWriter writer)
{
writer.WriteStartElement("Post");
writer.WriteStartElement("Student_ID");
writer.WriteString(stud_Id);
writer.WriteEndElement();
writer.WriteStartElement("Group_ID");
writer.WriteString(group_Id);
writer.WriteEndElement();
writer.WriteEndElement();
}
The problem is this the code above doesnt append to the xml file,it only overwrites the contents of the file everytime i complie the code. How do I get to append each time I compile and run the code?
Thanks in advance