使用wpf(离线)应用程序更新问题c#

时间:2022-09-01 19:16:15

Hi i have created weeks ago a WPF( visual studio 2010) application which runs offline localy on my pc.I is connected to a database(MS SQL .mdf) ofcourse and it works well. but now i need to make an update of the application and i wonder how to do it the main issue for me is how not to start with the empty database again how to make the update and use the already filled database? Any referals to where i can read something or some examples. THX EDIT: if its possible i want to do the update not using internet. The database structure is the same one i just made some changes to the code behind...

嗨,我几个星期前创建了一个WPF(visual studio 2010)应用程序,它在我的电脑上离线运行。我连接到一个数据库(MS SQL .mdf)的课程,它运作良好。但现在我需要更新应用程序,我想知道如何做到这一点主要问题是如何不再从空数据库开始如何进行更新并使用已经填充的数据库?任何我可以阅读某些内容或一些例子的侮辱。 THX编辑:如果可能我想要更新不使用互联网。数据库结构是一样的我只是对后面的代码做了一些修改......

2 个解决方案

#1


1  

You need an SQL Schema Compare tool to compare your old SQL Schema and new SQL Schema. There are various tools, in fact Visual Studio even has one.

您需要一个SQL架构比较工具来比较旧的SQL架构和新的SQL架构。有各种工具,实际上Visual Studio甚至有一个。

But for complex scenarios you may have free alternatives

但对于复杂情况,您可能有免费的替代方案

All you need is to define schema changes between your databases, and edit the generated diff SQL in order to preserve the data.

您所需要的只是在数据库之间定义模式更改,并编辑生成的diff SQL以保留数据。

#2


1  

i use SchemaCompares for that.

我使用SchemaCompares。

I create a new database ( I use local db) which contains all changes. After that i use the VS SchemaCompare to update my old one.

我创建了一个包含所有更改的新数据库(我使用本地数据库)。之后,我使用VS SchemaCompare来更新我的旧版本。

The SchemaCompare matches the diffences between both and update the old one. MSDN

SchemaCompare匹配两者之间的差异并更新旧的。 MSDN

The compare has also the abilty to fill not nullable new columns(native types) with the default values from the framework( int=0, bool=false...).

比较还具有使用框架中的默认值(int = 0,bool = false ...)填充不可空的新列(本机类型)的能力。

#1


1  

You need an SQL Schema Compare tool to compare your old SQL Schema and new SQL Schema. There are various tools, in fact Visual Studio even has one.

您需要一个SQL架构比较工具来比较旧的SQL架构和新的SQL架构。有各种工具,实际上Visual Studio甚至有一个。

But for complex scenarios you may have free alternatives

但对于复杂情况,您可能有免费的替代方案

All you need is to define schema changes between your databases, and edit the generated diff SQL in order to preserve the data.

您所需要的只是在数据库之间定义模式更改,并编辑生成的diff SQL以保留数据。

#2


1  

i use SchemaCompares for that.

我使用SchemaCompares。

I create a new database ( I use local db) which contains all changes. After that i use the VS SchemaCompare to update my old one.

我创建了一个包含所有更改的新数据库(我使用本地数据库)。之后,我使用VS SchemaCompare来更新我的旧版本。

The SchemaCompare matches the diffences between both and update the old one. MSDN

SchemaCompare匹配两者之间的差异并更新旧的。 MSDN

The compare has also the abilty to fill not nullable new columns(native types) with the default values from the framework( int=0, bool=false...).

比较还具有使用框架中的默认值(int = 0,bool = false ...)填充不可空的新列(本机类型)的能力。