Reputation:
I am using MVC5, how can I use different databases for different controllers ?
I have a connection string in my root web.config
and I wrote a different connection string in the area's web.config
. Why can I not connect to a different DB ?
Upvotes: 1
Views: 199
Reputation: 4772
Make sure that you gave your second connection string a different name. Names must be unique.
Also, you can just declare them all in the web.config
that is at the root of your project.
Upvotes: 0
Reputation: 407
You can declare multiple connection strings in global "web.config" file, and use required connection string at multiple places in the project...
Upvotes: 1