PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET When writing DataSet to disk

Reply

When writing DataSet to disk

 
Thread Tools Rate Thread
Old 13-05-2005, 07:27 PM   #1
Chris Botha
Guest
 
Posts: n/a
Default When writing DataSet to disk


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.


  Reply With Quote
Old 13-05-2005, 07:28 PM   #2
Marina
Guest
 
Posts: n/a
Default Re: When writing DataSet to disk

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.
>



  Reply With Quote
Old 13-05-2005, 09:30 PM   #3
Sahil Malik [MVP]
Guest
 
Posts: n/a
Default Re: When writing DataSet to disk

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.
>
>



  Reply With Quote
Old 15-05-2005, 09:00 PM   #4
Chris Botha
Guest
 
Posts: n/a
Default Re: When writing DataSet to disk

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.
> >
> >

>
>



  Reply With Quote
Old 16-05-2005, 03:15 PM   #5
Sahil Malik [MVP]
Guest
 
Posts: n/a
Default Re: When writing DataSet to disk

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.
> > >
> > >

> >
> >

>
>



  Reply With Quote
Old 19-05-2005, 05:04 AM   #6
Chris Botha
Guest
 
Posts: n/a
Default Re: When writing DataSet to disk

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.
> > > >
> > > >
> > >
> > >

> >
> >

>
>



  Reply With Quote
Old 20-05-2005, 12:33 PM   #7
Sahil Malik [MVP]
Guest
 
Posts: n/a
Default Re: When writing DataSet to disk

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.
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off