通过Clickonce更新升级SQL

通过Clickonce更新升级SQL

本文介绍了通过Clickonce更新升级SQL CE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近将现有的Clickonce应用程序开发项目从Visual Studio 2005迁移到VS2010。
由于Visual Studio 2010的升级问题,我们不得不将其SQL CE数据库从v3.1升级到v3.5。

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.

为避免数据迁移的麻烦,每次Clickonce更新发布时,我们一直将用户以前的数据库复制到其新的安装文件夹中。如果数据库有任何更改,我们会将它们编写脚本到应用程序的IsFirstRun事件处理程序中。

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.

但是,由于我们已经更改了数据库版本和已部署的SQL CE .dll文件,因此这意味着我们所有现有的客户端最终都将使用错误的数据库版本。

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?

谢谢

推荐答案

以下两篇文章可能对您有用。第一个是如何在部署中包含SQLCE dll,而不是将其作为先决条件进行部署。这样您就可以完全控制运行的版本。

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.

第二篇文章介绍了如何确保数据不受ClickOnce更新的影响。

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

这篇关于通过Clickonce更新升级SQL CE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 23:33