|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataTable WriteXml is in consistentThe 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. 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. 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. > > > 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. >> >> >> |
|||||||||||||||||||||||