none
Problem with DataSet.XmlRead RRS feed

  • Question

  • Hi,
    I have encountered an interesting problem. I have a data set with one table(Id + Object). When i save my data through DataSet.WriteXml() all is ok, but when i try to read this xml file some of data will be lost. Size of resulting file is about 1-2 mB.  Have you any ideas about solving this problem?
    Tuesday, July 31, 2007 7:50 AM

All replies

  • What kind of information was lost? Have you tried to call same method and specify to save schema as well, like DataSet.WriteXml("MyFileName", WriteSchema). It will preserve definition of the columns inside of the DataTable and might keep what was lost.

     

    Tuesday, July 31, 2007 10:33 AM
    Moderator
  • VMazur
    Thanks. Whole rows are lost. There is no a situation when DataSet fails to read object field or reads object field with wrong Id.
    Yes, I have tried with DataSet.WriteXml(Stream S, XmlWriteMode.WriteScheme). Result was the same. Now i have to parse my xml file manually(with XmlElement, XmlDocument classes) and add rows by hand.
    It works little slow, but prevents info lost. Is there any probability of error in DataSet class or it is my incompetence? If it is my fault could you give a link to manual that contains not only
    a structure of DataSet but also detailed description how it work.
    Wednesday, August 1, 2007 5:17 AM
  • It should store all the rows. Do you filter result of the DataSet somehow?

    Wednesday, August 1, 2007 9:51 AM
    Moderator