How to Switch connection strings

ADH

Member
Joined
Apr 17, 2005
Messages
22
Location
ISRAEL
Programming Experience
10+
In a VB2005 WinForms project.Settings I have declared 2 connection strings (1 for Development, 1 for Deployment/Run time).
Question:
Where in the solution can I _easily_ switch between them, (using an Application.CommandLineArg) so all the DataObjects and Binding objects will refer to the appopriate (choosen) Connection string ?
I have seen the posts on this issue, no easier way?!
Thanks
 
Last edited:
Switching connection strings at start up

Thanks for the reply (I was unpatient to get an answer...)
Still not clear for me:
I have done some bindings in code and there it is easy to switch connections, but some objects are binded by build in datasources objects which are dependent on the my.settings.connectionstring. For the moment I would like to leave them so (and not bind them in code), just to see how to solve the ConnectionSettings settings issue.
1) Were in the project do you do it, BEFORE the access of all the automated (not self-coded) bindings/DataSources?
2) How to modify the app.connectiomstring.settings
while they are read only?
3) In the ASP 2 projetcs.app.Config file there is such an option: loading a specific ConnectionString dependent on another app.setting/param. Nothing of it in WinForms? (if not then....it should........)
Thanks
 
1) answered in the links I gave, read them again
2) answered in the links I gave, read them again
3) take it to Microsoft, not us
 
Back
Top