Save a DataTable to SQL Server database and make the database table at the same time

I have a DataTable object, filled with data from an existing query (used a DataAdaptor and SQL statement).

I want to put the data in this DataTable object into a new table in an SQL Server database.
How do I make the table and populate it as fast as possible from a C# application?
Who is Participating?
Bob LearnedConnect With a Mentor Commented:
If you have an existing DataTable, and you don't have a target table, you could use SMO to create the target table, and then use SqlBulkCopy (if you have 2005) to quickly insert the records from the DataTable.

You can use SELECT INTO statement to input data to new table in SQL Server.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.