问题描述:

I have a WPF application that I have published a year ago and had been using it(and MSSQL database .mdf-extension) that I filled by the past year with some data.

Now I have made some changes in the code behind (filename.cs) in my application so when I publish I get a fresh new database. And I want to use the already filled database.

How do I accomplish that(This comes like an upgrade/update to my WPF app)?

网友答案:

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.

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.

相关阅读:
Top