You do this in one of three ways: When you data bind dataset tables to controls on a Windows Form or XAML page, the data binding architecture does all the work for you.
If you're familiar with Table Adapters, you can jump directly to one of these topics: Updating a data source is a two-step process.
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.
However, if the Missing Schema Action property is set to Add With Key, appropriate primary keys and constraints are also created. For every inserted, modified, and deleted row, the Update method determines the type of change that has been performed on it (Insert, Update or Delete).
Depending on the type of change, the Insert, Update, or Delete command template executes to propagate the modified row to the data source.
The Sql Data Adapter uses the Connection object of the .
So if you would try to omit that line the changes doesn't reflect in your datasource as what you have noticed..
This is the reason why I am asking whether it is mandatory to update the Data Table first before updating the data source? As what i have observed in your code you are just Updating the values from your Database and not in the Data Table so thats why its mandatory to have that line you have commented out..
The Fill operation then adds the rows to destination Data Table objects in the Data Set, creating the Data Table objects if they do not already exist.
When creating Data Table objects, the Fill operation normally creates only column name metadata.