Search code examples
visual-studio-2010sql-server-2008windows-7database-connectionvisual-web-developer

Unexpected error when trying to connect to database in Visual Studio 2010


The problem:

In Visual Studio 2010 Professional I choose Server Explorer and right-click on Data Connections to choose "Add Connection". Then I get this error:

An unexpected error occurred in the .NET Framework Data Provider for Microsoft SQL Server Compact 3.5. Please contact the provider vendor to resolve this problem.

My enviroment:

  • Windows 7 SP1
  • Visual Studio 2010 Professional (trial version)
  • SQL Server 2008 R2 Express

I've tried

  • Installing Visual Web Developer Express (gives the same problem)
  • Reinstall of VS 2010 Professional
  • Reinstall of Sql Server 2008 R2 Express
  • Tools => Import and Export Setting => Reset all Settings
  • Run: Devenv.exe /ResetSkipPkgs

Comments

Maybe the registry is messed up in some way. One post: http://social.msdn.microsoft.com/Forums/en/vstsstart/thread/b6f7fc36-5a34-4166-9e75-7ac39993182b

says that I should modify the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders

But I don't even have a folder named DataProviders in the 9.0 (or 10.0) folder. So maybe that's a problem.

Thanks for any help!


Solution

  • I started "add and remove programs" and removed everything that was named something about "Visual Studio". Then I reinstalled Visual Studio 2010 Professional. And now it works!