locked
"The given key was not present in the dictionary" error when adding a data connection to a local database (sqlexpress 2008) in VS 10 RRS feed

  • Question

  • Hi, I'm using Visual Studio 2010 Utimate (latest version, beta 2 I believe).

    It was working for some time, and since about a week ago, without any (intentional) changes to VS settings, I am having problems connecting to the data base. I have a database running (sqlexpress 2008) on the same computer.

    On the server explorer my connection to database under Data Connections appears with an (X) mark. When I try to refresh it I get a pop up saying "Server Explorer is unable to perfom this operation. See below for details:
    Object reference not set to an instance of an object"

    If I try to delete this connection,I get the error message
    "The given key was not present in the dictionary"

    If I try to create a new connection to my database (using Add Connection) I get
    "Unable to add data connection. The given key was not present in the dictionary".
    However, if I test connection to the database the test succeeds.

    I've uninstalled VS 10 on my computer, clearted the registry entries for VS 10 and reinstalled it, but I'm still getting the same error.

    Could someone pls help ?

    Many thanks.

    CL

    Wednesday, March 3, 2010 5:24 PM

Answers

  • Hello,

    You may try the following steps to see if it helps:

    a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

    b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

    c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

    d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

    e)      Try to create a new user account. This can help isolate user profile corruption related causes.

    In addition, Microsoft Visual Studio 2010 Ultimate RC has been released, you could get it from here:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a&displaylang=en

    If this issue still exists, you could post your issue on the Preleased versions of Visual Studio Team System 2010 Forum to see if any community members have came across this issue and had any suggestions.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    • Marked as answer by Edwer Fang Wednesday, March 10, 2010 2:07 AM
    Friday, March 5, 2010 9:16 AM

All replies

  • Same error.

    Thursday, March 4, 2010 9:22 PM
  • Hello,

    You may try the following steps to see if it helps:

    a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

    b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

    c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

    d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

    e)      Try to create a new user account. This can help isolate user profile corruption related causes.

    In addition, Microsoft Visual Studio 2010 Ultimate RC has been released, you could get it from here:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a&displaylang=en

    If this issue still exists, you could post your issue on the Preleased versions of Visual Studio Team System 2010 Forum to see if any community members have came across this issue and had any suggestions.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    • Marked as answer by Edwer Fang Wednesday, March 10, 2010 2:07 AM
    Friday, March 5, 2010 9:16 AM
  • I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

    C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

    Works now.

     

     

    • Proposed as answer by prifre Thursday, September 16, 2010 7:43 AM
    Monday, June 21, 2010 9:15 PM
  • Worked like a charm for me as well.  Thanks a mil for the suggestion.
    Wednesday, July 14, 2010 1:08 PM
  • Worked perfectly for me too - the folder I removed was called

    C:\Users\prifre\AppData\Local\Microsoft\VisualStudio\9.0

     

    I wonder why the error appeared...

     

    with a smile

    /prifre

    Thursday, September 16, 2010 7:45 AM
  • I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

    C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

    Works now.

     

     

    Thats Really works!!!!!!!!!!!!!!!!!!! 
    Thursday, January 13, 2011 2:27 PM
  • Hi

    Reselved to select GConfiguration Property->debug to lounch, select local debugger

     

    Wednesday, June 29, 2011 1:38 PM
  • Thank you kaletm.

    Deleting the directory that you mentioned solved this problem for me.

    Tuesday, July 19, 2011 5:13 PM
  • Hello,

    You may try the following steps to see if it helps:

    a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

    b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

    c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

    d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

    e)      Try to create a new user account. This can help isolate user profile corruption related causes.

    In addition, Microsoft Visual Studio 2010 Ultimate RC has been released, you could get it from here:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a&displaylang=en

    If this issue still exists, you could post your issue on the Preleased versions of Visual Studio Team System 2010 Forum to see if any community members have came across this issue and had any suggestions.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    I have just started getting this error. I have tried a) b) c) in addition to deleting the directory that was listed in a later post.
    The test connection is working for me as well, but after I click the OK button I get the error mentioned above.
    I am using the Release version of Visual Studio 2010. 
    Help. This just happened to me, and is killing my ability to work on things.
    • Proposed as answer by Soner KOYLU Monday, September 8, 2014 10:55 AM
    Tuesday, July 26, 2011 6:18 AM
  • I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

    C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

    Works now.

     

     

    This did NOT work for me!
    Wednesday, July 27, 2011 11:47 PM
  • I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

    C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

    Works now.

     

     

    This did NOT work for me!

    Deleting the local appdata path did not work for me either (Windows 7, VS2010), but roaming did!

    So whereas deleting C:\Users\<me>\AppData\Local\Microsoft\VisualStudio\10.0 did not work, deleting C:\Users\<me>\AppData\Roaming\Microsoft\VisualStudio\10.0 did!

    In my case, the culprit was that I had an old SQLite connection in the list, but had removed the provider.

     

    • Proposed as answer by gindi Friday, January 27, 2012 10:25 PM
    Tuesday, November 8, 2011 8:59 AM
  • Hi, I confirm that removing roaming path (Win7 32bit, VS2010) did work for me. Very thanks.
    Friday, January 13, 2012 8:13 AM
  • Thanks,

    it work perfect for me, too (Win7/32b, VS2010)

    • Proposed as answer by Ekalavyaa Sunday, March 4, 2012 9:01 PM
    Tuesday, February 14, 2012 12:41 PM
  • Thanks,

    it work perfect for me, too (Win7/32b, VS2010)

    It worked for me as well.

    Thank you for sharing the solution.

    Problem : Error while trying to add a new database using Server Explorer in VS.NET 2010

    Error        : The given key was not present in the dictionary

    Solution : Remove forlder  : C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

    Sunday, March 4, 2012 9:03 PM
  • I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

    C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

    Works now.

    You're simply great.

    Thank you.

    Sunday, April 8, 2012 5:38 PM
  • A less invasive approach is to delete: C:\Users\USERNAME\AppData\Roaming\Microsoft\VisualStudio\10.0\ServerExplorer\DefaultView.SEView

    Shawn Camp

    Tuesday, April 10, 2012 4:35 PM
  •  This is working for me Thanks!
    Thursday, November 22, 2012 6:44 AM
  • So whereas deleting C:\Users\<me>\AppData\Local\Microsoft\VisualStudio\10.0 did not work, deleting C:\Users\<me>\AppData\Roaming\Microsoft\VisualStudio\10.0 did!

    thanks really works.
    Monday, April 9, 2018 11:32 PM