G
Guest
This question is similar to one asked previously, but I'm wondering how to
automate the process.
My program queries a custom library object which returns a DataSet result.
The library is configured to act as a method for querying databases (sql or
mdb) and passing back the resulting data.
Note: This library is a required part of my project and must be included.
On to the question...
I have a DataSet with a DataTable in it, and I need to export this to a SQL
server or to an Access (mdb) file to use as a temporary sandbox, since I'm
unable to modify the original data. The data in the sandbox will be heavily
modified and needs to be seperate from the original.
I _do_ know the schema of the tables I want to write/export, but I have a
dozen or so of them and automating the process would be wonderful. I
understand I have to use the SQL CREATE TABLE command, but is there a way to
generate a CREATE TABLE string using the field names and datatypes from my
DataTable?
Thanks in advance.
PS: Any samples in C# would be extremely helpful.
automate the process.
My program queries a custom library object which returns a DataSet result.
The library is configured to act as a method for querying databases (sql or
mdb) and passing back the resulting data.
Note: This library is a required part of my project and must be included.
On to the question...
I have a DataSet with a DataTable in it, and I need to export this to a SQL
server or to an Access (mdb) file to use as a temporary sandbox, since I'm
unable to modify the original data. The data in the sandbox will be heavily
modified and needs to be seperate from the original.
I _do_ know the schema of the tables I want to write/export, but I have a
dozen or so of them and automating the process would be wonderful. I
understand I have to use the SQL CREATE TABLE command, but is there a way to
generate a CREATE TABLE string using the field names and datatypes from my
DataTable?
Thanks in advance.
PS: Any samples in C# would be extremely helpful.