Today I noticed that in my ConfigurationManager.ConnectionStrings
the very first instance is .\SQLEXPRESS
. I remembered explicitly removing this entry from my web.config so I checked again, but didn't find a thing. Then I did a search over my entire solution, not a single match.
Where the hell is this connection string coming from and how can I remove it?
config file in the Views folder.) Find the <connectionStrings> element: Add the following connection string to the <connectionStrings> element in the Web. config file.
To read the connection string into your code, use the ConfigurationManager class. string connStr = ConfigurationManager. ConnectionStrings["myConnectionString"].
It's in there by default, pulled in from your machine config file. To get rid of it just put
<clear />
Above your first connection string to remove it.
It comes from the machine.config.
However you may remove it, if you wish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With