views:

443

answers:

1

All

I have built a windows form application using VS 2005 Standard edition which uses SQL Express as the database.

I'd now like to deploy my application to another PC that has .NET framework and SQL Server already installed.

The bit I am unclear about is what do I need to do to ensure that my database is also deployed with my application?

I have spent most of the day reading various articles from msdn to other blogs and I can't get a clear understanding on what is the best way to deploy my application. Some of the varying advice includes:

  • Add a 'setup' project and create a setup.exe file
  • Use a custom action to create a database during installation (uses installer class)
  • Manually detach .mdf and .ldf from database and use command line on target PC to reattach to database
  • Amend .config file to get new connection string (from target machine) and then reference that in my ado.net code
  • etc. etc.

Can anybody cut through the confusion for me and help me out?

Thanks

A: 

Here’s the simplest way I can think of:

  • Build the application
  • Copy the executable (in the Bin directory) and the app.config file to the other machine. The executable and app.config need to be in the same folder
  • Backup the database on your machine and restore it on the other machine
  • Change app.config to point to the restored database
rip
Thanks for help. A few follow up questions: In my Bin\Release directory there are myproject.exe and myproject.vshost.exe - which do I copy as the executable?
Remnant
myproject.exe is the executable you need
rip