How to deploy a Windows form application, including a database, to another computer?

Everything

I created a Windows form application using the standard version of VS 2005, which uses SQL Express as the database.

Now I would like to deploy my application on another PC with the .NET platform and SQL Server installed.

I don’t understand a bit, what do I need to do so that my database is also deployed with my application?

I spent most of the day reading various articles from msdn on other blogs, and I cannot get a clear idea of ​​what is the best way to deploy my application. Some of the various tips include:

  • Add the 'setup' project and create the setup.exe file
  • Use an arbitrary action to create the database during installation (uses the installer class)
  • Manually separate .mdf and .ldf from the database and use the command line on the target PC to connect to the database
  • Modify the .config file to get a new connection string (from the target computer), and then specify what is in my ado.net code
  • etc .. and others.

Can someone miss me the confusion and help me?

thanks

+4
source share
1 answer

Here is the easiest way:

  • Application creation
  • Copy the executable file (in the Bin directory) and the app.config file for another machine. The executable and app.config should be in the same folder
  • Back up the database on your machine and restore it to another machine
  • Modify app.config to point to the restored database
+1
source

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


All Articles