Visual Studio Adding Data Connections - Given Key not Present in the Dictionary

时光总嘲笑我的痴心妄想 提交于 2019-12-23 08:18:32

问题


I've read through a couple of previous similar questions and none seem to provide a fix. so i ask again. I'm using Visual Studio and am trying to connect to a DB in Server Explorer. Regardless of what database i try to connect to it gives a "Given Key not Present in the Dictionary" error. i have tried with SQL CE and SQL Express 2008 databases and each give the same issue.

I can connect quite easily with SQL Management Studio Express so i believe the Databases are the same.

Thanks in Advance.


回答1:


after a lot of time searching for the answer to this i found the solution here

this is not really a workaround but in fact a SOLUTION, how to get rid of the error, in case you have missed to remove all connections before removing the provider:

edit C:\Users...\AppData\Roaming\Microsoft\VisualStudio\10.0\ServerExplorer\DefaultView.SEView and remove the connection with the wrong Provider manually. If you do not know which of the provider is failing, simply delete the file :)

If this won't help try deleting also C:\Users...\AppData\Local\Microsoft\VisualStudio\10.0

PS: you have to quit all instances of visual studios first or the files will be re-created from memory ..

The second part only worked for me , deleting the whole folder.




回答2:


I had recently installed the MySQL Connector, and had multiple instances of Visual Studio open. After shutting them all down, I was able to add a connection to the Server Explorer.

Adding to what BastanteCaro said, I had open the DefaultView.SEView file in case I needed to go down that path. When I shut everything down and started up a new instance of Visual Studio, Notepad++ reported that the file had changed. So either there was an uncommitted change to the file or some sort of cleanup/addition was made on startup.




回答3:


I was having the same error "Key not Present in Dictionary" in VS 2010 when adding a Postgresql database connection, deleting the entire folder C:\Users...\AppData\Local\Microsoft\VisualStudio\10.0 as pointed out by BastanteCaro solved the issue.



来源:https://stackoverflow.com/questions/4737170/visual-studio-adding-data-connections-given-key-not-present-in-the-dictionary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!