none
There was an error generating the XML document.

    Question

  • Hi

    When I run my program I see the error "There was an error generating the XML document."

    I am new in C#

    please advise

      public class SerializableData
      {
        public void save(string filename)
        {
          String tmpFileName;
          tmpFileName = filename + ".tmp";
    
          FileInfo tmpFileInfo = new FileInfo(tmpFileName);
          if (tmpFileInfo.Exists)
            tmpFileInfo.Delete();
          FileStream stream = new FileStream(tmpFileName, FileMode.Create);
          save(stream);
          stream.Close();
          tmpFileInfo.CopyTo(filename, true);
          tmpFileInfo.Delete();
        }
        public void save(Stream stream)
        {  
          XmlSerializer serializer = new XmlSerializer(typeof(SerializableData));
          serializer.Serialize(stream,this);
        }
      }
    Wednesday, June 02, 2010 7:39 PM

Answers

All replies