"Tony Johansson" <jo*****************@telia.comwrote in message
news:eu**************@TK2MSFTNGP02.phx.gbl...
Assume the following :
1. I create a DataSet with some DataRelation.
2. I then use WriteXml to write the DataSet to an Xml document using
DataRelation.Nested = True
3.I then read the Xml document using ReadXml to load and create a DataSet.
Now to my question is this DataSet that was created from 3 the same
DataSet
with the same structure
that existed when I wrote down using WriteXml using point 2 above.
In step 3 you will only be sure to get an accurate duplicate of the
schema of the original dataset if you use the "WriteSchema" option when you
do the WriteXml in step 2:
myDataSet.WriteXml("file.xml", XmlWriteMode.WriteSchema);
This adds an xsd schema at the beginning of the written file, which can
then be used by ReadXml to reconstruct the original schema before loading
the data that follow. You can open the file with an editor to verify whether
the DataRelation does make its way into the schema (I believe it does).