Import typed DataSet to SQL Server
I want to import a typed DataSe开发者_JAVA技巧t 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
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.
Can you use the SqlDataAdapter's Update method?
精彩评论