Page 1 of 1

DataTable to XML

Posted: Mon 21 Sep 2009 02:42
by giovanni
I am currently using VS2008 (3.5 SP1) to build a .NET Web Service. I am using a typed DataSet which contains a DataTable and a DataTableAdapter. I am able to retrieve the information I need into a typed DataTable (ClientDataTable). So far, so good.

The problem is that I need to export the data in the typed DataTable to XML. While I am able to do this, I am returned XML which contains .NET specifics (IsDataSet = true, etc...). I need to obtain ONLY the XML which is WS-I Basic Profile 1.1 compliant as my Web Service contains the EmitConformanceClaims and ConformsTo attributes.

In essence, the XML needs to be as agnostic and interoperable as possible as it will be used by differnet platforms. I also need it to be self-describing so I need to include XML schema information so web service consumers know what a "Client" is and what an "Order" is; basically self-descriptive. I am open to using LINQ, XMLWriters, XMLReaders, etc...

In addition, I need to ensure that I am able to emit parent-child type XML (Orders -> Order).

Can anyone please help?


Best Regards,

Giovanni

Posted: Tue 22 Sep 2009 12:58
by Shalex
Could you please try using the WriteXml() method of the Devart.Data.MySql.MySqlDataSet and Devart.Data.MySql.MySqlDataTable classes? I have tried generating the XML document with data from the database tables. There are neither IsDataSet = true nor other attributes. If you want to change the node tags, you can do this by editing XML manually. Please correct me, if I've got you wrong.