How to: Persist Data Changes to the Database (Devices)
Use these procedures to persist changes that were made to data in device projects.
The following steps, written in C# and relying on the Customers table of the Northwind database, assume that you have a dataset (not any other kind of data source) in the Data Sources window. For more information, see How to: Add a Database to a Device Project.
Note
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.
To persist data changes to the database
Drag a table from the Data Sources window onto a Windows Form.
Drag a button onto the form.
Change the Text property of the button to Save.
Double-click the button on the form to open the code editor at the button click event handler.
Type the following code:
this.customersBindingSource.EndEdit(); this.customersTableAdapter.Update(this.northwindDataSet. Customers);