Brian Webster
Brian Webster

Reputation: 30855

.NET - Is it possible to write a DataTable directly to a SQL Database?

I'd like to do something like the following:

Dim Conn as new SqlConnection(ConnectionString)

MyDataTable.WriteToDB(Conn, "New Table")

Are there any shortcuts like this built into .NET?

Thanks

Upvotes: 0

Views: 48

Answers (1)

Dean Harding
Dean Harding

Reputation: 72658

You probably want to start with the SqlDataAdapter class. It was pretty much designed to do exactly this.

Upvotes: 2

Related Questions