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: