amer
amer

Reputation: 623

How can I create setup file for c# project?

How can I create a setup file including sql server 2008 that is needed for database for a c# project ?

Upvotes: 1

Views: 495

Answers (2)

Essam Fahmy
Essam Fahmy

Reputation: 2245

I have faced the same problem about how to get the setup file to work in any other device although it takes some time for me to understand the process but finally i have found that it's really simple.

1) you need to change the connection string to something like that :

string connectionStr = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|DatabaseName.mdf;Integrated Security=True";

2) you can use Advanced Installer to generate the setup file, the process is simple, you can watch any short tutorial about how to get the setup file with Advanced Installer on youtube.

3) Finally, You have to install 3 programs as Prerequisites in client pc :

  • .Net Framework (I think started from version 4.5)
  • Sql Server Express
  • SSMS (Sql Server Management Studio)

Upvotes: 0

Jalal Said
Jalal Said

Reputation: 16162

To create a setup file for your project, you can use Setup Project, it will handle many things for you, however if you want also to include the sql server, you can include its setup file, and then run it programmatically using Process.Start method, and pass the required args to it. Check out here, here and here is for examples on how it could be done.

Upvotes: 1

Related Questions