Change SQL Express LocalDB Database Structure in Visual Studio Project

Hello,

I have a VS2013 project, (WPF, C#), that has a .mdf file that I use for the application.  I'm using SQL Express 2012 LocalDB.  I'm using Entity Framework 6.

I created the DB in the project by -> Add New Item -> Service-based Database.

I then added my Tables with the appropriate fields, relationships and so forth.

I then added Add New Item -> ADO.NET Entity Data Model -> EF Designer from database

obviously selecting the database I created above.

Everything works great.  So I deploy me application to end users using Flexera InstallShield. 

Everything works.

So here is the question.  If I make a structural change to the Database, (e.g. Add a field/column to a table, or add a new table), how do I get this database change down to the end users database, that have already installed my application, without deleting or stepping on their existing data?

Thank you in advance.

August 20th, 2015 12:35pm

Hi 7VN,

Since the issue is more related to deploying database in Visual Studio project, I would recommend you post the question in the SQL Server Data Tools forum or  Visual Studio forums to get better support.

Also there are some articles about changing database schema in Visual Studio project for your reference.
https://msdn.microsoft.com/en-us/data/jj206878.aspx?f=255&MSPPError=-2147217396
https://msdn.microsoft.com/en-us/library/aa833261(v=vs.100).aspx


Thanks,
Lydia Zhang

If you have any feedback on our support, please click here.

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 2:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics