views:

54

answers:

1

I'm consuming a 3rd-party web service that outputs a Dataset (from XML). I'd like to create a new table in my local MS Access database that contains the DataSet data.

Is there a simple way to hand-off the DataSet to a .net object and ask it to "create a table from this"?

I know that we can use different parts of ADO to extract schema, build commands, insert rows, etc. I figured there has to be a simpler way.

+1  A: 

The only two ways I know of are to

  1. Walk through the DataSet field by field and generate a DDL instruction (which is valid for MS-Access)

  2. Add a reference to ADOX, create a new table (with columns) and append the new table to the ADOX catalog. More info here. But again you are walking throught the dataset table field by field.

I haven't provided much detail on either of these approaches since I don't think they match what you've specified.

It seems you are looking for a quicker way than either of those so I guess the answer to your question is no.

hawbsl
Seems to me that if you could write the XML dataset to a file, you could then use SQL to work with it via ADOX. But I've no experience with that of my own, so I could be misinterpreting what I know about it (which is not that much).
David-W-Fenton