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.
Hirendra SisodiyaPosted Dec 20, 2011, 3:02 AM
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..
guna sPosted Dec 20, 2011, 3:02 AM
--guna
Pravin GhadgePosted Dec 20, 2011, 2:53 AM
Plz refer foll link:
http://vijirajkumar.blogspot.com/2010/03/create-setup-and-deployment-project.html
guna sPosted Dec 20, 2011, 2:50 AM
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
Dharmesh SharmaPosted Dec 20, 2011, 2:33 AM
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
Pravin GhadgePosted Dec 20, 2011, 2:30 AM
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.
guna sPosted Dec 20, 2011, 2:24 AM
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 GhadgePosted Dec 20, 2011, 2:17 AM
Have u installed Sql Server or Sql Express?