Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Application and Data File Man... > Migrating SQL Compact Edition Databa...

Migrating SQL Compact Edition Database Files

The download code for this chapter includes a sample called SQLCompactDefaultMigration that you can use to see what happens if you do not properly migrate your data when a data file update occurs. That sample includes two versions of the application: v1.0.0.0 and v2.0.0.0. They both use trimmed down versions of the Northwind.sdf file from the Mobile SDK as a client-side data store that is integrated into a data-bound form in the application.

The first version just contains the Customers table in the database and presents the Customers data in a grid, and lets you edit fields in the grid and save the changes back to the database through a BindingNavigator (toolbar) control at the top of the form. The second version adds the Orders table (and a couple of related tables) to the database with a foreign key relation between Customers and Orders. The second version application adds a master-details view of the data with two grids in the form (see Figure 5.14). Because the second version needs to ship a new version of the database, which is just an .sdf file being used by the application as a data file, you will run into the data file migration problems described earlier.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint