How to deploy a .mdf file

I am trying to create an application that uses a local .mdf database file (not bound to sql server). Visual Studio says that before that I have to install SQL Server Express. I was wondering how I can deploy the application in a client window. Do they also need SQL Server Express?

thanks a lot

+6
source share
3 answers

They need to install SQL Server Express. After installation, you need to attach the database file (.mdf) to the server.

+4
source

Do not deploy MDF. Ask the application to use deployment scripts and run scripts that create the database, as well as scripts that create all the objects in the database. The problem with deploying a binary file (.MDF) is that you cannot update it. Come v. 1.1 of your application, you will face the dilemma of deploying your new MDF, but save all the data saved by users in the old .MDF. This is not a trivial problem. Red Gate is trying to push a continuous integration solution that uses diff tools to create maintenance / upgrade scripts. Microsoft is promoting a database project that works similarly based on diff comparisons made using the vsdbcmd tool. I'm not a fan of differences-based tools; they tend to make bad decisions; I much prefer explicit update scenarios .

+4
source

in the solution explorer, right click on your project

then to the new item

then select a service-based database

create a database and use it

0
source

Source: https://habr.com/ru/post/886731/


All Articles