views:

21

answers:

1

I have a DataSet with multiple tables (distinct schema).

I want to generate table schema on SQL Server 2005 and insert data into the dynamically created table.

Table name should be the name of DataTable (which is unique i.e. data0, data1, ...)

Is there a way to insert it in to the SQL Server database without going through DataTable row by row (using xml)? Any code samples or links would be great. Thank you all very much

+1  A: 

The schema you have to create yourself in the DB
However you can use the SqlBulkCopy class to put the data from the datatable in the database in one pass.

See article here

Julian de Wit