DataTable WriteXml is in consistent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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?
 
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..
 
Back
Top