tags:

views:

614

answers:

4

Hi,

I have an xml document which looks like this:

OK suppressionlist_get Suppression List Get 24 Oct 08 @ 10:16AM [email protected] RECIPSELF Recipient self suppressed 23 Oct 08 @ 8:53PM facm

I have omitted the closing of the document for clarity and to keep this post short.

Anyway, I have a gridview and I want to bind this XML to the gridview so I get table, like:

email type long created user data data data data data

And so forth.

I was playing with datasets and xmldatadocuments and when stepping through, each attribute seemed to be represented as its own table in a data collection table.

Any ideas on how to achieve the above? I thought it was as simple as just adding a gridview, and xml data source with the data file specified.

Thanks

A: 

Create a test DataSet and write it out to Xml to get a feel for the Xml format used by a dataset, then either convert the Xml format to match this and then load it in to the Dataset using DataSet.LoadXml().

Or you could build a DataSet on the fly from your existing Xml format.

benPearce
A: 

Never mind I managed to work out the problem, after much experimenting!

Blade
A: 

Is there a quick way I can write the dataset to a file (ie csv)? I've tried dataset.writexml and various similar methods, but it usually writes the top level details and not the actual data.

Now I have my grid as I explained in my first post.

Blade
+1  A: 

Actually, I will just convert the xml to a format presentable in csv via xslt - much easier.

Blade