I added a connection and it shows up in "Other Connections" but I can't seem to reference it.
var db = Database.Open("MyNewConnection");
throws an exception: Connection string 'MyNewConnection' was not found.
I added a connection and it shows up in "Other Connections" but I can't seem to reference it.
var db = Database.Open("MyNewConnection");
throws an exception: Connection string 'MyNewConnection' was not found.
Have you checked to make sure your connection string is correct in your web.config file?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add
name="MyNewConnection"
connectionString= "server=myServer;database=myDatabase;uid=username;pwd=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>