Upgrading SQL CE via Clickonce update

六眼飞鱼酱① 提交于 2019-12-14 02:34:54

问题


We have recently moved an existing Clickonce app development project from Visual Studio 2005 to VS 2010. Due to an upgrade issue with Visual Studio 2010, we've had to upgrade its SQL CE database from v3.1 to v3.5.

To avoid data migration headaches, we have been copying the user's previous database into their new installation folder each time a Clickonce update is published. If there are any DB changes, we script them into the app's IsFirstRun event handler.

But now, since we've changed the database version and the deployed SQL CE .dll files, it means that all our existing clients will end up with the wrong database version.

We have a rather large user base, and we face problems if we require all existing users to export their data, completely uninstall, then reinstall the new version.

QUESTION: Is there a way to upgrade the existing database in-place programmatically?

THANKS


回答1:


Here are two articles you might find useful. The first one is how to include the SQLCE dll's WITH your deployment rather than deploying it as a prerequisite; this gives you total control over what version you are running.

http://robindotnet.wordpress.com/2010/02/28/how-to-deploy-the-sqlserver-compact-edition-software-locally/

The second article is about how to keep your data safe from ClickOnce updates.

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




回答2:


Sure, use the SqlCeEngine upgrade API, even supports in place upgrades: http://erikej.blogspot.com/2010/08/how-to-upgrade-version-3x-database-file.html



来源:https://stackoverflow.com/questions/4340534/upgrading-sql-ce-via-clickonce-update

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!