DataTable to XML

DataTable to XML

Postby giovanni » Mon 21 Sep 2009 02:42

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,

Posts: 5
Joined: Wed 09 Sep 2009 14:11

Postby Shalex » Tue 22 Sep 2009 12:58

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.
Devart Team
Posts: 7888
Joined: Thu 14 Aug 2008 12:44

Return to dotConnect for MySQL