views:

647

answers:

1

I'm wondering how to add several data tables that I've built in code, to a blank MDB file that ships with my app.

I find it easy enough to connect to the MDB file via the OledbConnection object, but then I'm at a loss for an easy way to add my tables to it. There it sits...open...and empty, but what next?

I can add my tables to a dataset easily enough, but I still don't see an easy way to map the dataset over to my open MDB file.

Am I missing an easy fix for this? I'd like to avoid using ADOX if possible. I also see that it is very easy to write the dataset out as XML, but find no similar functionality for writing out an MDB file.

Any help would be appreciated.

A: 

DataSet intriniscally understands the XML storage, you might think of it (very loosely mind) as its native data store. In fact XML storage is meant for temporary or transistory storage so that a DataSet can be re-constituted between application re-starts or transference between machines.

On the other hand, true persistance stores such as MDB, SQL Server, Oracle or whatever are entirely alien to the Dataset, thats why you need provider specific Adapters to transfer data to and from the Dataset.

Unless you can find a project out in web-land where someone has done this before you are going to need to create your own code to analyse the dataset schema then send DDL to you MDB connection to create the tables.

AnthonyWJones