Why do deleted data connections come back in Visual Studio?

In Visual Studio 2008, I have database connections in the Server Explorer window that point to SQL Server databases installed locally on my PC.

When I delete one of the connections in goes, but next time I start Visual Studio is is back again.

Does anyone know how to remove them properly?

It isn't a big deal, but it is a bit annoying.

Thanks.

Answers


I found the solution to this problem by noticing that the 'deleted' Database Connections only re-appear in Server Explorer when I open the Solution file (previously, I had VS set to open the last project on start-up).

So, knowing it must be something in the solution, I searched the files and I have a Database Project which holds build scripts, etc. In this project, within the *.dbp file, there is a "DBRefFolder" section. The 'deleted' database references were here, and when I deleted them, all was well.

It is a bit annoying that VS doesn't remove these entries properly, but at least I have a solution.

Below is an sample extract from the *.dbp file:

Begin DataProject = "SQL Server Databases"
    ...
    ...
    ...
    ...
    Begin DBRefFolder = "Database References"
        Begin DBRefNode = "Name"
            ConnectStr = "Data Source=XXX;Initial Catalog=YYY;Integrated Security=True"
            Provider = "{91510608-8809-4020-8897-FBA057E22D54}"
            Colorizer = 6
        End
        ...
        ...
        ...
        ...
    End
End

Just delete your web.config or other config files like app.config connection strings that you don't need them again. I test it for about half a day and deleting the unneeded connection strings from config file help me not loading again that connection string in server explorer of visual studio 2012. Wish you luck


Delete them, close Visual Studio, clear your ASP.NET Temporary Files, then start Visual Studio.


VisualStudio doesn't actually save every little project or worspace setting change you make. I often find things like added or removed projects are back to the way they were before if I shutdown my machine without first nicely exiting out of VS.

So I'd highly suggest closing nicely out of VS after making any setting change you don't want lost.

You'd think a Microsoft-built program wouldn't be the one program I use that can't handle a shutdown request properly and has to be manually closed first, but nooooo....


Steve, I have been dealing with this issue for a couple of days. Not only was I not able to remove the old connection, but I was also unable to add a new connection.

Here is what I found after searching high and low.

On Windows 7 and perhaps Vista try renaming or deleting this file "DefaultView.SEView" in this folder C:\Users...\AppData\Roaming\Microsoft\VisualStudio\9.0\ServerExplorer

Someone else said to remove the file from AppData\Local but that's just not right.


I used notepad++ "Find in Files" function to search the data connection name, I believe you can search the following folder:

C:\Users\YOURNAME\Documents\Visual Studio 2013\

The following file has the data connection:

C:\Users\YOURNAME\Documents\Visual Studio 2013\WebSites\WebSite1\Web.config

Delete the following statement which has the data connection:

< add name="YOURCONNECTIONSTRINGNAME" connectionString="server=****;user id=****; database=****; ersistsecurityinfo=True; password=****" providerName="MySql.Data.MySqlClient" />


Need Your Help

Free memory ARC removing array of views elements

ios objective-c arrays memory-management automatic-ref-counting

I have a 2D array which represents a grid (every element in the array is an array which elements are cells).

Generic method for converting string array into list

c# .net generics

I would like to create a function that will return list of type that is specified by me at run time.