There is no one shot method.
There is a straightforward programmatic way to do this, i.e.
1. First create the table by using ExecuteNonQuery with a Create table
statement.
2. Then run a loop with another DbCommand (SqlCommand?) that acts row by
row.
The above approach might be terribly slow but is a fully managed solution.
Your other choice is to export the DataTable to XML and then use a SQL
Server import process.
This approach will be quicker, but it will be not fully managed. This will
also require you to first create the table.
- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------
"Vanclei Matheus" <(E-Mail Removed)> wrote in
message news:68CC7ACA-7DFD-45A0-B1C6-(E-Mail Removed)...
> Hello people,
>
> Is there a way to "save" an ADO DataTable in a physical database.
> For example, i have an in memory DataTable that i created using ADO.Net
> Methods and i want to create a physical table in the database with the
> same
> attributes of my DataTable during run-time.
>
> Thanks
> Vanclei