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.

Unable to add data connection. Key not valid for use in specified state.
appferreira
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
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
crabman27
simkinnet
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