<ConnectionStrings>
<add name="DB1" connectionString="server=1.12.123.1234;database=database1;allowuservariables=True;user id=remoteUser;password=tmppassword123;" />
<add name="DB2" connectionString="server=localhost;database=carpartstore;allowuservariables=True;user id=root;password=tmppassword123;"/>
</ConnectionStrings>
And in HomeController.cs :
public static string conSTring = System.Configuration.ConfigurationManager.ConnectionStrings["DB1"].ConnectionString;
but conSTring is NULL and creates exception when I try to create MYSQLCONNECTION.
What am I missing here?