Hello,
    I'm new to C# development. I've been working on a C# project (management system). Depending on the requirements i may have to build further versions of software. I want to know how to build the database such that even when i install next version of software, it would load the previous database records? 
    I'm not sure about this because i think that if i make an updated version of software and install it on machine, the database would also be created from scratch and it would load the new blank database (removing all the previous records).


Regards.

Your question doesn't make much sense to me. Both versions would be configured to point to a database, so you could easily tell the new version to point to an existing database. The only problems that might arise are changes in the database schema in the new version. In that case you have no choice but to create a new database and migrate data over from the old one. But that's a natural part of destructive upgrades anyway.

It seems almost like your database is tied far too closely to a specific version of the project somehow, though I can't imagine how.

To preserve the old DB, do not include the DB it self in the setup, or when publishing, and also you can create a setup to include the db if it does not exists. (Please see the installshield help on dependencies).

Hope this helps

Salam alikum wa rahmat allah wa brakatah, Faisal. I think that depends on your software requirements. Having said that you can pretty much do both, creating a new database or/and connecting to a previous database. This depends on the way you set up your project.

I'm assuming that for a local database (the one gets shipped with a piece of software and gets installed automatically on user's machine to store online content and make the content easily accessible when the user is not connected to the internet) might be a little hard. Unless you know where it is stored on the user's machine and doesn't get deleted after a newer version of your software is installed.

I hope that answers your questions.

This article has been dead for over six months. Start a new discussion instead.