Root Element Not Found Error!

inkedGFX

Well-known member
Joined
Feb 2, 2013
Messages
142
Programming Experience
Beginner
I am trying to save Contact info in an XML file..when I run the program I get a "root element not found" error...

here is the code

 
File.Create(Path + "@\\AddressBook\\ContactInfo.xml"); //Create the File
                XmlTextWriter xWriter = new XmlTextWriter(Path + "@\\AddressBook\\ContactInfo.xml" , Encoding.UTF8);
                xWriter.WriteStartElement("root");
                xWriter.WriteStartElement("Contacts");
                xWriter.WriteEndElement();
                xWriter.WriteEndElement();
                xWriter.Close();


the problem with this code is that it doesnt write either of the start elements....
any Ideas?

Thank You
InkedGFX
 
Top Bottom