DataTable WriteXML Problem

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
giovanni
Posts: 5
Joined: Wed 09 Sep 2009 14:11

DataTable WriteXML Problem

Post by giovanni » Tue 29 Sep 2009 18:36

Hi,

Vistual Studio 2008 – 3.5 SP1
MySQL Server 5.1.30

I use the DataSet Wizard to build a DataSet. My situation is such that I am using a stored procedure as a data source and not a table. Therefore, to my knowledge, to make this work, I must uncheck the “Use provider-specific code generator when creating typed DataSet”. If I do not uncheck this option, then I will not be able to access my table adapters and use their Fill and GetData methods; please correct me if I am wrong. Doing so generates standard .NET DataSet, DataTable, and DataTableAdapter objects and NOT MySql.Data.MySqlClient based objects.

My problem: I need to use the .WriteXml method of a DataTable to write the XML to a file or stream. This I can do. The real problem is the fact that additional attributes are included in my output,
when I use the System.Data.XmlWriteMode.WriteSchema parameter on the .WriteXML method. This poses a major problem as my Web Service has to deliver neutral/agnostic XML and NOT .NET related information.

What follows is an example of what I am returned when using the .WriteXML method with the problematic attributes bolded for emphasis.
I need to ensure interoperability with other platforms as well as include XML schema information so that it is self-describing; what I don’t need is any Microsoft, .NET, or DataSet related attributes.

Can you please help me output neutral XML from a DataTable?


Method: clientDataTable.WriteXml(@"C:\test.xml", System.Data.XmlWriteMode.WriteSchema);

Output:






Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 01 Oct 2009 09:27

We will investigate the issue with the XML generation and notify you about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 21 Oct 2009 13:19

Currently we don't have any plans concerning changing of the default behaviour of XML generation. We will consider such possibility in the future.

Post Reply