Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does this permanent SQLExpress connectionstring come from (not web.config)?

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?

like image 725
Boris Callens Avatar asked Nov 24 '09 13:11

Boris Callens


People also ask

Where do I put connectionString in web config?

config file in the Views folder.) Find the <connectionStrings> element: Add the following connection string to the <connectionStrings> element in the Web. config file.

How do you read connectionString from configuration file into code behind?

To read the connection string into your code, use the ConfigurationManager class. string connStr = ConfigurationManager. ConnectionStrings["myConnectionString"].


2 Answers

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.

like image 175
Chris Meek Avatar answered Oct 12 '22 14:10

Chris Meek


It comes from the machine.config.

However you may remove it, if you wish.

like image 23
treaschf Avatar answered Oct 12 '22 13:10

treaschf