Home All Groups Group Topic Archive Search About

DataTable WriteXml is in consistent

Author
4 Feb 2006 8:23 PM
Oldman
The DataTable WriteXml produces different xml based on whether the table is
part of a dataset or not.
This means that anybody consuming the xml has to read it differently because
it ends up with different root nodes based on the circumstances.
Is there a way to prevent this?

This is VERY annoying.

Author
10 Feb 2006 4:52 PM
Mateus Padovani Velloso
What about instancing a new dataset and using the merge method to import
only the table you want to export, and then exporting to xml?

Show quote
"Oldman" <Old***@discussions.microsoft.com> wrote in message
news:37AC0D58-43C8-42A9-8553-C2512E476E0A@microsoft.com...
> The DataTable WriteXml produces different xml based on whether the table
> is
> part of a dataset or not.
> This means that anybody consuming the xml has to read it differently
> because
> it ends up with different root nodes based on the circumstances.
> Is there a way to prevent this?
>
> This is VERY annoying.
Author
10 Feb 2006 4:10 PM
Oldman
That is what we were doing prior to .NET 2.0.  The WriteXml method being
added to the datatable was a bonus for us because we thought we were going to
be able to eliminate that overhead of the merge.

I don't usually gripe but this was a very bad decision by the design team it
should be consistent.

Show quote
"Mateus Padovani Velloso" wrote:

> What about instancing a new dataset and using the merge method to import
> only the table you want to export, and then exporting to xml?
>
> "Oldman" <Old***@discussions.microsoft.com> wrote in message
> news:37AC0D58-43C8-42A9-8553-C2512E476E0A@microsoft.com...
> > The DataTable WriteXml produces different xml based on whether the table
> > is
> > part of a dataset or not.
> > This means that anybody consuming the xml has to read it differently
> > because
> > it ends up with different root nodes based on the circumstances.
> > Is there a way to prevent this?
> >
> > This is VERY annoying.
>
>
>
Author
11 Feb 2006 4:03 PM
Mateus Padovani Velloso
Well, and what if you convert DataSet to a xmlDocument and then extract only
the relevant node? I guess it could offer a better performance..

Show quote
"Oldman" <Old***@discussions.microsoft.com> wrote in message
news:C0A676A7-D959-43E8-9288-B7867F0DA450@microsoft.com...
> That is what we were doing prior to .NET 2.0.  The WriteXml method being
> added to the datatable was a bonus for us because we thought we were going
> to
> be able to eliminate that overhead of the merge.
>
> I don't usually gripe but this was a very bad decision by the design team
> it
> should be consistent.
>
> "Mateus Padovani Velloso" wrote:
>
>> What about instancing a new dataset and using the merge method to import
>> only the table you want to export, and then exporting to xml?
>>
>> "Oldman" <Old***@discussions.microsoft.com> wrote in message
>> news:37AC0D58-43C8-42A9-8553-C2512E476E0A@microsoft.com...
>> > The DataTable WriteXml produces different xml based on whether the
>> > table
>> > is
>> > part of a dataset or not.
>> > This means that anybody consuming the xml has to read it differently
>> > because
>> > it ends up with different root nodes based on the circumstances.
>> > Is there a way to prevent this?
>> >
>> > This is VERY annoying.
>>
>>
>>

AddThis Social Bookmark Button