After upgrading my Visual Studio 2008 to Visual Studio 2010 my server explorer decided to give me the following error.

An unexpected error occurred in the .NET framework data provider for Microsoft SQL Server Compact. Please contact the provider vendor to resolve this problem.

Now this could be happening on any version of the compact framework.  First close Visual Studio before continuing.

Edit the registry

Open up your registry by going to run on the start menu and typing regedit.  In the registry editor go to the following location:

On 32-bit version of Windows
HKEY_LOCAL_MACHINESOFTWAREMicrosoftVisualStudio10.0DataProviders
On 64-bit version of Windows
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftVisualStudio10.0DataProviders

You will see that there is a few folders in that directory, depending on what version gives you the error go through the folder and look for your version on the right under InvariantName.  Change the folder on the left to “backup.{and the key}.

Now close the registry editor and open visual studio again.

Happy programming!