i don't have any code for this theme. I have a "problem" with the access to many databases. I wrote a program where you can login and do some stuff (create reports etc). Bevore you login, the program should have a look in the local database to which system the user belongs. After that the connection string should change to get a connection to this system.
I need that because this reporting application is on our local server but the detailed datas of the users and every datas for creating reports are on the customer server. So step by step:
- User types in his login datas
- program should check the system for user in local db (like a table with "user1"-"system2")
- program should change constring or should use the constring for this system
- after that the login on this system starts in code behind
- user is logged in on his system
I've never done something like this and i read many times that it's not possible to change the constring in runtime. So i thought i can write every constring into the web.config and just tell him
If(user.system == 3){ use constring3 };
I really don't know how to handle this.
Thanks for every support.
Cheers Dave