I have attached a screenshot of the error iam facing after installing the setup.exe file in another machine and on opening the project, it shows the error in the screenshot when i click the login button..
Note:
I have included mdf file in my project using the connection string
SqlConnection con = new SqlConnection("Data Source=.;AttachDbFilename=|DataDirectory|\\project.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
after this i created the setup file..
can u pl help me how to create setup file with sql database
Thanks in advance.

Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 19, 2011, 9:17 PM EST
Have u installed Sql Server or Sql Express?
guna s12 reputationPosted Dec 19, 2011, 9:24 PM EST
Is it necessary to install sql server in the machine where ever we are installing the setup file?. I have not installed. Is this the error because of it?.. For me i dont want to do so. Please let me know if there is any other option.
Thanks,
guna
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 19, 2011, 9:30 PM EST
When u are creating setup at that point, there is option of Prerequisites in that u just have to click on sql express.
So when u install ur setup it will automatically install sql server.
Or
u can manually install sql server/sqlexpress on that PC.
Dharmesh SharmaRank #1,974 · 741 reputationPosted Dec 19, 2011, 9:33 PM EST
As you show sql link of database connection you need to install the sql instance with setup
when you create a setup then right click of project and check the box to copy the dependancy in setup folder then you create a setup
when you install the setup any system then Requirments first install automatically then you software
thanks
guna s12 reputationPosted Dec 19, 2011, 9:50 PM EST
I cant figure out the Prerequisites option. Will you please say me with the steps. It will be very helpful for me as well as the followers.
Thanks,
Guna
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 19, 2011, 9:53 PM EST
Plz refer foll link:
http://vijirajkumar.blogspot.com/2010/03/create-setup-and-deployment-project.html
guna s12 reputationPosted Dec 19, 2011, 10:02 PM EST
--guna
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Dec 19, 2011, 10:02 PM EST
you can install Sql server express edition with your setup and write the code for attaching database in the Installer class.
from above all the things will be done during installation...
if you need to more clarification then let me know..