>Can a connection string be change at run time? I have develop an application from my home office and in my connection string I have the IP address for the server I'm hitting. Now I'm going to move my app in side the office I need to change the IP address to the server I'm wanting to use.
>
>I think this is what's going on the app runs fine from my home office I have move it to the office I'm getting the connection failure error and when the dialog box comes up I can enter in the IP address and all works fine.
>
>Or any ideals on how to handle this.
What I do is to have something like this in a configuration file:
[System]
ConnectionString=1
[ConnectionString]
ConnectionString1=Provider=VFPOLEDB.1;Data Source="d:\iis\MyWebSite\App_Data";Password='';Collating Sequence=MACHINE
ConnectionString2=Data Source=MyPC;Initial Catalog=My Catalog;Integrated Security=True
ConnectionString3=Provider=VFPOLEDB.1;Data Source="d:\iis\MyWebSite2\App_Data";Password='';Collating Sequence=MACHINE
So, at run time, you can read the configuration file and know which connection string to use.