If you do send the changes back to the database, then a second step is required.
If you aren't using data-bound controls, then you have to manually call the Update method of the same Table Adapter (or data adapter) that you used to populate the dataset.
The following examples demonstrate how to perform updates to modified rows by explicitly setting the Private Sub Adapter Update(By Val connection String As String) Using connection As Sql Connection = New Sql Connection( _ connection String) Dim adapter As Sql Data Adapter = New Sql Data Adapter( _ "SELECT Category ID, Category Name FROM dbo. Update Command = New Sql Command( _ "UPDATE Categories SET Category Name = @Category Name " & _ "WHERE Category ID = @Category ID", connection) adapter.
Fill(category Table) Dim category Row As Data Row = category Table.
encounters a change to a Data Row, it uses the Insert Command, Update Command, or Delete Command to process the change. Rows(0) category Row("Category Name") = "New Beverages" adapter. Write Line("Rows after update.") Dim row As Data Row For Each row In category Table. Write Line(": ", row(0), row(1)) Next End Using End Sub either by returning the auto-increment value as an output parameter of a stored procedure and mapping that to a column in a table, by returning the auto-increment value in the first row of a result set returned by a stored procedure or SQL statement, or by using the are sent to the data source is important.
The Table Adapter Manager class ensures that updates are made in the correct order based on the foreign-key constraints that are defined in the database.
When you use data-bound controls, the databinding architecture creates a member variable of the Table Adapter Manager class called table Adapter Manager.
For more information, see Hierarchical Update Overview.
of the problem I'm having is errors with the primary key.