connect in multiple sqlserver databases

0

Good Night, I'm developing a system in MVC 5 and C #, I have two SQLSERVER databases, one for Development and one for Production.

Please inform me how to configure WebConfig to accept these two connections and if I need to build some class that does this.

Better clarifying:

When we develop the application we have a development web server that communicates with a sqlserver database server for development, once this application is ready, it goes up to the production web server which should communicate with the SQLSERVER production server.

What do I need to do and configure webconfig to recognize which bank it should communicate to without having to change it manually as I have been doing.

    
asked by anonymous 13.11.2017 / 02:16

1 answer

1

By default in your MVC project your web.config will already have two base transformation files: Web.Debug.config and Web.Release.Config. Both are already configured to, when compiling your code, overwriting the main web.config with the information you want. So, if you publish your application in Release Mode your web.config will have the connection string of Web.Release.config, and if you publish in debug, your web.config will have the connection string with Web.Debug. config.

It's worth noting that you are not limited to just two transformation files, you can still create others according to your needs.

    
13.11.2017 / 11:38