Re: DataSet and serialization is dangerous
From: ABad (anonymous_at_discussions.microsoft.com)
Date: 02/02/05
- Next message: sutphinwb_at_nospam.nospam: "Lazy filling a large dataset"
- Previous message: Anatoly: "Re: Reserved Keywords"
- In reply to: Mauricio Pires: "DataSet and serialization is dangerous"
- Next in thread: ABad: "Re: DataSet and serialization is dangerous"
- Reply: ABad: "Re: DataSet and serialization is dangerous"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Feb 2005 20:22:23 -0500
You may have to look deeper into the different serialization/deserialization
techniques and the options with each one, and how their round-trip usage
produces results that may differ with the original in-memory representation.
Using the technique you have shown the resulting XML file has the previous
version with only the father, but it also has the new dataset version with
the father and child relationship. So the data isn't lost, but the
serialization and deserialization technique you have chosen may cause
different in-memory representations than the original dataset. Looking at
the GUI results thats my guess on what is happening. The read dataset is
showing only the previous version while the original is showing the new
dataset version.
If you change your serialization/deserialization technique to:
- dsOriginal.WriteXml("myFileName.xml",XmlWriteMode.WriteSchema)
- dsRead = new Dataset
- dsRead.ReadXML("myFileName.xml",XmlReadMode.Auto)
You get the results you expect. This shows this
serialization/deserialization technique produces what the original dataset
had in-memory.
Just an observation.
- ABad
- Next message: sutphinwb_at_nospam.nospam: "Lazy filling a large dataset"
- Previous message: Anatoly: "Re: Reserved Keywords"
- In reply to: Mauricio Pires: "DataSet and serialization is dangerous"
- Next in thread: ABad: "Re: DataSet and serialization is dangerous"
- Reply: ABad: "Re: DataSet and serialization is dangerous"
- Messages sorted by: [ date ] [ thread ]