Wednesday, March 28, 2012

Putting Data From DataTable/DataSet into SQL Server Table?

Hello,

I created this DataTable, add rows of data to it, and then display the data on to a form via a repeater.

Dim ds As DataSet = New DataSet
Dim dtTableName As DataTable = New DataTable("dtTableName")
dtTableName.Columns.Add("Description")
dtTableName.Columns.Add("ItemNumber")
dtTableName.Columns.Add("Quantity")
dtTableName.Columns.Add("Price")
ds.Tables.Add(dtTableName)

What I need to do now is create a table in SQL Server and update the database with the data I've collect in my dataset. How do I bind and update this data to a sql server table?

Thanks!
James

Check out this walkthrough (it uses a DataGrid and DataSet):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkWalkthroughUpdatingDataUsingDatabaseUpdateQueryInWebForms.asp

No comments:

Post a Comment