Marc
Marc

Reputation: 2859

Import typed DataSet to SQL Server

I want to import a typed DataSet with DataTables (not with TableAdapters) to my SQL Server database. The structure of all DataTables in the DataSet is the same like in the SQL Server database. With the same fields.

How can I import the whole typed DataSet to my SQL Server database?

Best regards

Upvotes: 0

Views: 1123

Answers (2)

AdaTheDev
AdaTheDev

Reputation: 147374

If you're just inserting data, and want the quickest way to insert data in to SQL Server, use the SqlBulkCopy class.

One of the WriteToServer overloads of that class accepts a DataTable as a source of data to be bulk loaded into the underlying table.

Upvotes: 2

Ta01
Ta01

Reputation: 31630

Can you use the SqlDataAdapter's Update method?

Upvotes: 1

Related Questions