PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
When writing DataSet to disk
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
When writing DataSet to disk
![]() |
When writing DataSet to disk |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I'm using theDataSet.WriteXml(...) to write the DataSet to disk. After
that, when I read the DataSet from disk (theDataSet.ReadXml), then if there were tables with no records, they are gone. Same for table columns that contained only null values, not there any more either. Thanks for any pointers. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
This is what it does. Check for properties or overloads of WriteXml to see
if anything can change it. It may be that you are stuck with this. "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message news:eDHH2k%23VFHA.2256@TK2MSFTNGP14.phx.gbl... > I'm using theDataSet.WriteXml(...) to write the DataSet to disk. After > that, when I read the DataSet from disk (theDataSet.ReadXml), then if > there were tables with no records, they are gone. Same for table columns > that contained only null values, not there any more either. > > Thanks for any pointers. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Save it with the schema.
- Sahil Malik [MVP] http://codebetter.com/blogs/sahil.malik/ "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message news:eDHH2k#VFHA.2256@TK2MSFTNGP14.phx.gbl... > I'm using theDataSet.WriteXml(...) to write the DataSet to disk. After > that, when I read the DataSet from disk (theDataSet.ReadXml), then if there > were tables with no records, they are gone. Same for table columns that > contained only null values, not there any more either. > > Thanks for any pointers. > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Problem is the DataSet is generated on the fly, depending on parameters it
has different tables, coming from different databases. "Sahil Malik [MVP]" <contactmethrumyblog@nospam.com> wrote in message news:eAaUeq$VFHA.3152@TK2MSFTNGP12.phx.gbl... > Save it with the schema. > > - Sahil Malik [MVP] > http://codebetter.com/blogs/sahil.malik/ > > > > "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message > news:eDHH2k#VFHA.2256@TK2MSFTNGP14.phx.gbl... > > I'm using theDataSet.WriteXml(...) to write the DataSet to disk. After > > that, when I read the DataSet from disk (theDataSet.ReadXml), then if > there > > were tables with no records, they are gone. Same for table columns that > > contained only null values, not there any more either. > > > > Thanks for any pointers. > > > > > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Even then, try WriteXmlSchema/ReadXmlSchema.
- Sahil Malik [MVP] http://codebetter.com/blogs/sahil.malik/ "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message news:#I47NjYWFHA.3712@TK2MSFTNGP09.phx.gbl... > Problem is the DataSet is generated on the fly, depending on parameters it > has different tables, coming from different databases. > > "Sahil Malik [MVP]" <contactmethrumyblog@nospam.com> wrote in message > news:eAaUeq$VFHA.3152@TK2MSFTNGP12.phx.gbl... > > Save it with the schema. > > > > - Sahil Malik [MVP] > > http://codebetter.com/blogs/sahil.malik/ > > > > > > > > "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message > > news:eDHH2k#VFHA.2256@TK2MSFTNGP14.phx.gbl... > > > I'm using theDataSet.WriteXml(...) to write the DataSet to disk. > After > > > that, when I read the DataSet from disk (theDataSet.ReadXml), then if > > there > > > were tables with no records, they are gone. Same for table columns that > > > contained only null values, not there any more either. > > > > > > Thanks for any pointers. > > > > > > > > > > > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
WriteXmlSchema does what it says, it writes the schema, no data.
However using theDataSet.WriteXml(fileName, XmlWriteMode.WriteSchema) does the job. Thanks. "Sahil Malik [MVP]" <contactmethrumyblog@nospam.com> wrote in message news:uvUOyGiWFHA.2128@TK2MSFTNGP14.phx.gbl... > Even then, try WriteXmlSchema/ReadXmlSchema. > > - Sahil Malik [MVP] > http://codebetter.com/blogs/sahil.malik/ > > > > "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message > news:#I47NjYWFHA.3712@TK2MSFTNGP09.phx.gbl... > > Problem is the DataSet is generated on the fly, depending on parameters it > > has different tables, coming from different databases. > > > > "Sahil Malik [MVP]" <contactmethrumyblog@nospam.com> wrote in message > > news:eAaUeq$VFHA.3152@TK2MSFTNGP12.phx.gbl... > > > Save it with the schema. > > > > > > - Sahil Malik [MVP] > > > http://codebetter.com/blogs/sahil.malik/ > > > > > > > > > > > > "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message > > > news:eDHH2k#VFHA.2256@TK2MSFTNGP14.phx.gbl... > > > > I'm using theDataSet.WriteXml(...) to write the DataSet to disk. > > After > > > > that, when I read the DataSet from disk (theDataSet.ReadXml), then if > > > there > > > > were tables with no records, they are gone. Same for table columns > that > > > > contained only null values, not there any more either. > > > > > > > > Thanks for any pointers. > > > > > > > > > > > > > > > > > > > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Great !! .. Yeah I thought there was an overload that'd do the job. Anyway,
I've been MIA from the NGs in the past 3 weeks - been terribly busy, but I'll be back in action in about a week. - Sahil Malik [MVP] http://codebetter.com/blogs/sahil.malik/ "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message news:%238BqMfCXFHA.3320@TK2MSFTNGP12.phx.gbl... > WriteXmlSchema does what it says, it writes the schema, no data. > However using theDataSet.WriteXml(fileName, XmlWriteMode.WriteSchema) > does > the job. > > Thanks. > > "Sahil Malik [MVP]" <contactmethrumyblog@nospam.com> wrote in message > news:uvUOyGiWFHA.2128@TK2MSFTNGP14.phx.gbl... >> Even then, try WriteXmlSchema/ReadXmlSchema. >> >> - Sahil Malik [MVP] >> http://codebetter.com/blogs/sahil.malik/ >> >> >> >> "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message >> news:#I47NjYWFHA.3712@TK2MSFTNGP09.phx.gbl... >> > Problem is the DataSet is generated on the fly, depending on parameters > it >> > has different tables, coming from different databases. >> > >> > "Sahil Malik [MVP]" <contactmethrumyblog@nospam.com> wrote in message >> > news:eAaUeq$VFHA.3152@TK2MSFTNGP12.phx.gbl... >> > > Save it with the schema. >> > > >> > > - Sahil Malik [MVP] >> > > http://codebetter.com/blogs/sahil.malik/ >> > > >> > > >> > > >> > > "Chris Botha" <chris_s_botha@AThotmail.com> wrote in message >> > > news:eDHH2k#VFHA.2256@TK2MSFTNGP14.phx.gbl... >> > > > I'm using theDataSet.WriteXml(...) to write the DataSet to >> > > > disk. >> > After >> > > > that, when I read the DataSet from disk (theDataSet.ReadXml), then > if >> > > there >> > > > were tables with no records, they are gone. Same for table columns >> that >> > > > contained only null values, not there any more either. >> > > > >> > > > Thanks for any pointers. >> > > > >> > > > >> > > >> > > >> > >> > >> >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

