Unable to add data connection. Key not valid for use in specified state.

Using Visual Studio 2005, I am no longer able to add data connections to my projects.

After testing the connection to an existing database and clicking OK, I get the 2-line message "Unable to add data connection. Key not valid for use in specified state."

I am able to work with the databases using sqlcmd and SQL Server Express Manager.



Answer this question

Unable to add data connection. Key not valid for use in specified state.

  • appferreira

    hey Ali,

    If you could explain me what you did. That would be helpful.


    Im still getting the same error. """Key not valid for use in specified state"""

    And i checked and deleted all the datasource. But still when i try to add a datasource it again shows me the same message. my email id is hiten@nit-me.com.

    Thanks pal


  • H.T.Chien

    I ran into to this this AM as well. I had to change my password this morning and when I changed it back to the old one all worked fine. We still have a NT domain not AD. Anyway hope this helps.

    Bruce



  • FirePhoenix

    After encountering this error, I deleted all unused datasources, some of which didn't work. This seemed to of done the trick.

    Therefore, delete any DataSources that do not work.

    Kurt


  • jvinsky

    I have the same issue. Very frustrating!!

    I have tonnes of code to rewrite if I cannot fix this bug!! Please help! Please do not suggest re-installing VS2005.



  • KoryS

    I have the same thing, Not modified the data sources for ages, now a user wants an item adding to the database so I was about to modify to use the new item and voila.

    Nothing works I have removed all the data sources (shows no data sources at all) and I have tried to add a data source and got the same message every time.

    I cannot see any other method around this, does MS expect you to completely rewrite the application to get around this .


  • W-i-s-e_G-u-y

    Even after three installs of visual studio and Sql server, no help. I erased the hard drive and re-installed windows, then vs then sql and all works. A very sad way to have to do something, but. On the server I had yet more fun from the domain change. All is now working.

  • Dahlman

    I found a relevant bug report (FDBK18994) in
    http://lab.msdn.microsoft.com/productfeedback/default.aspx
    the MSDN Product Feedback Center.

    I solved the problem by renaming the VisualStudio folders in
    ..\Application Data\Microsoft
    ..\Local Settings\Application Data\Microsoft
    to VisualStudioXXX

    I had installed Visual Studio Team System (after I got the CD-ROMs in the mail) on top the express editions of Visual C# and Visual Web Developer. I did not experience any problems for several weeks. After renaming the two directories, I have a cleaner looking GUI that has Team Explorer and Class View tabs. I even have File-New-Project. Now I understand why the labs and webcasts have looked different from my version.


  • Iain Maxted

    Have you checked the VS 2005 Beta site to see if this bug has been reported, or has a workaround

  • crabman27

    Sunday, we changed our domain name, (parent company deemed we fit under thier domain) So I promo'd our server and removed our domain and then promo'd it back to their domain. when I changed my computer to the new domain, I found all of the programs which ran perfect on the old domain, now would not even start. I figured maybe just go in and change the datasource to reflect the new domain. When I tried to access any data function, I get a pop up "Unable to add data connection. Key not valid for use in specified state." Nothing mentioned prior in this string have worked. HELP!!!


  • simkinnet

    This fix is temporary for me.  Every time I log off and back on, the problem reoccurs.  My work-around is to delete the data connections and rebuild them.

    Kevin

  • radpin

    This solution worked for me.

    1. Open the registry

    2. Rename [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0]

    To [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0back]

    3. Restart Visual Studio

    Ali


  • Unable to add data connection. Key not valid for use in specified state.