private readonly string _connectionString =
ConfigurationManager.ConnectionStrings["productsDb"]
.ConnectionString; //It finds the connection string
var db = new Database(_connectionString); //This line throws the error
it throws the error:
Additional information: Can't find a connection string with the name 'Server=server-name;Database=database;Integrated Security=True;'
Ah, I got it. There is no need to get the connection string, I just need to pass the name from the web.config into the first overload of the Database object like this:
Can't connect to external database using Database(...)
I added the following connection string in my web.config:
But when I try to access it via:
it throws the error:
Additional information: Can't find a connection string with the name 'Server=server-name;Database=database;Integrated Security=True;'
Ah, I got it. There is no need to get the connection string, I just need to pass the name from the web.config into the first overload of the Database object like this:
is working on a reply...