Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Everybody

ASM
I have also added the following connection string in my config file, but still there is error

add name="cn" connectionString="Data Source=AMAN;Initial Catalog=HOSTSDB;User ID=SA;Password=1234
add name="FBTS.Properties.Settings.HOSTSDBConnectionString" connectionstring="Data Source=.;AttachDbFilename=C:\FBTS\FBTS\DB\HOSTSDB.mdf;Initial Catalog=HOSTS;Integrated Security=True" providername="System.Data.SqlClient"

add name="cn" connectionstring="Data Source=AMAN;Initial Catalog=HOSTSDB;User ID=SA;Password=1234"


Pls help me how to run my exe on other computer
Posted

 
Share this answer
 
Comments
Aman4.net 18-Apr-13 2:02am    
SIR ACTUALLY THE PROBLEM IS THAT I HAVE ALREADY DATABASE IN MY PROJECT. I WANT TO USE THAT DATABASE. WHEN I CREATE THE .EXE FILE THAT CAN BE INSTALLED ON ANY COMPUTER , AND THAT EXE WILL WORK WITH DATABASE. I HAVE INSTALLED DATABASE IN THE CLIENTS MACHINE. NOW WHEN I INSTALL THAT EXE , IT SHOWS DATA BASE ERROR. BUT WHEN I INSTALL THE SAME EXE ON MY COMPUTER ON WHICH I HAVE CREATED THATEXE IT WORKS FINE,.
SO PLS TELL ME HOW TO MAKE IT WORK ON ANY PC...
THANKS
Mehdi Gholam 18-Apr-13 3:14am    
Obviously your connection string is wrong, see he link and it will help you.
Mycroft Holmes 18-Apr-13 2:09am    
Oops and you got shouted at hah hah!
Aman4.net 18-Apr-13 2:12am    
CAN U HELP ME @ MYCROFT HOLMES
Mycroft Holmes 18-Apr-13 2:15am    
Certainly not, I refuse to help anyone who shouts and uses txt speak. Learn to be polite and use the keyboard! Besides Karthik has given you an excellent link by the looks of it
Hi,

take look at the below article.
Walkthrough: Using a Custom Action to Create a Database at Installation [^]

hope it helps.
 
Share this answer
 
I created and new form and put a text box in it. We have to insert server name in that text box,
once we click the submit button, it update the connection string in config file, once changed it will executed on any machine.

Thanks all for your support.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900