Changing connection string at run time
I know I am slightly out of the scope of this forum but you might be able to point me in the right direction... As far as I can see this thread is the only one that has dealt with the problem of changing connection strings runtime.
I have a native C/C++ project, compiled and working with /clr. In addition I reference and use a C#-DLL which accesses a database. I need to change the connection string preferrably globally for the DLL, adding username and password (using SQLServer authorisation).
My questions are:
1. Can my problem be dealt with in the same way as suggested here?
2. The DLL app.config entries should probably be added to the exe's app.config?
3. Can a Win32 application compiled with /clr use an app.config file, and how do I make it load at startup (to make the event trigger)? Can it have an application domain at all?
All this because it is too easy to start using the wizards and get the data up and running immediately. I just wonder why the connection string cannot be replaced without going all the way through config files etc. I really need to change a simple property, that's all I want. I have solved the problem somewhere else by using a global variable and changing all the connection strings for each and every tableadapter, but it makes me scream and shout as long as I know there is a single named property within the class library that should have changed it all.
Any help and pointers appreciated!
Ole

