How to modify the webconfig connection string from the controller

0

I have this conexionstring and I would like from the controller to change the data source and other parameters, how can I do this? Thanks in advance

    
asked by Raidel Fonseca 17.01.2018 в 16:47
source

1 answer

1

You can not do that. The configuration file is a non-editable file at runtime or compilation, used for what its own name defines.

What you can do is indicate several connection chains and at run time use one or the other, precisely for that there is the configuration file (you configure different chains to use during execution).

In the config you define as many connection chains to the different databases as you need and depending on the user that initiates the session (or operation that you are going to do), you use one or the other. It's just adding more lines <add name=...../>

    
answered by 17.01.2018 в 17:32