Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have set the connection string of my dataset(typed) as

Data Source=MyHomeServer\SQLEXPRESS;Initial Catalog=dbTestSharing;Integrated Security=True
This is going to be a client side application. I need to change the machinename in the connection string so it could connect with server.
I donot know how to change it.

Thanks
Posted
Updated 20-Jan-12 5:33am
v2

1 solution

Place your connection string in the .config file for your application and retrieve it from there.
That file can be edited in each installation so that you do not require a recompile for each install.

Check out these links to help in understanding how to use these configuration files.
Storing and Retrieving Connection Strings[^]

When deploying the application on a client machine, the .config file that is deployed with the application is a plain text file that can be opened in Notepad and simply updated with the appropriate connection string required.
 
Share this answer
 
v2
Comments
Furqan Sehgal 20-Jan-12 11:47am    
Could u please explain a bit further? Where to locate the file and how how to edit it during installation? Thanks
fjdiewornncalwe 20-Jan-12 13:28pm    
I have updated my answer for you.

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