Question

I have a WPF application that has an embedded SQL Server CE database in it that the application uses for storing data. I plan to use ClickOnce for deployment, but would not want the database on the client machine to be overwritten every time the user installs the latest version.

How would the user update my application without updating the SQL Server CE embedded database in the WPF application?

Also, If I needed to add tables or columns to an existent SQL Server CE embedded database on a client application without recreating the database and the user losing their config, how would I do that. Any ideas on how to solve these problems?

THANKS!

Was it helpful?

Solution

For question number 1, see http://robindotnet.wordpress.com/2009/08/19/where-do-i-put-my-data-to-keep-it-safe-from-clickonce-updates/

For the second question: include a table in your database with a single row with a single value to indicate the current datatbase schema version.

One each launch of your app, check that the version is the expected, potentially newer one, and if not, for each missing version Count, run ALTER TABLE and CREATE TABLE statements to bring the database up to date. Remember that a newer app might need to upgrade the database several generations.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top