Updating the Microsoft SQL Server CE Database by Using the SqlCeDataAdapter

Once a DataSet has been populated by using the SqlCeDataAdapter, you can make changes to the data and then update the data source by using the same SqlCeDataAdapter. In order for the SqlCeDataAdapter to update the data source, you must specify three additional SqlCommand objects for the SqlCeDataAdapter's UpdateCommand, InsertCommand, and DeleteCommand properties.

These commands will need to be parameterized commands so that the SqlCeDataAdapter will be able to update individual rows in the data source tables. To learn more about parameterized SQL commands, see the section titled “Using Parameterized SQL Commands” in this chapter. Listing 7.11 demonstrates how to create ...

Get Microsoft® .NET Compact Framework Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.