Friday, February 24, 2012

Add connction Fails in VS.NET with SQL Server Everywhere

When I try to use the "Data Source Configuration Wizard" (Menu: Data\Add New Data Source...) and I try to add a new Connection to the "Northwind.sdf" database using Microsoft SQL Server Mobile Edition it fails with

"Unable to find the requested .Net Framework Data Provider. It may not be installed."

What's really strange about this is that if I click the Test Connection" button it states "Test Connection Succeeded."

I've looked everywhere and I see that other have had the same problem but no one seem to know the solution.

jc3

This usually happens if you un-install .Net Fx and re-install. So please go to ADd Remove programs and do repair for Microsoft SQL Server 2005 Mobile Developer Tools. This will add some extra config entries which will help you.|||

Nope, unfortunately that was not the cause of the problem because I never un-installed (or re-installed) .NET FX, but here's what I did to figure it out...

1. I did a repair of Visual Studio but that didn't work.

2. I wrote a sample application that just opened a connection and loaded a dataset and that worked so this particular problem is strictly a Visual Studio issue.

3. I got on a friends machine whose "Data Source Configuration Wizard" worked and ran FileMon (from SysInternals) to see what the wizard was actually doing and noticed it was reading from Machine.config so I searched his Machine.config and noticed an entry for "SQL Server CE Data Provider" that my copy of Machine.config did not have.

4. Since I was using the latest CTP and he was using the default version that shipped with VS I didn't copy his entry but instead composed my own using one of the other as a template as well as using the GAC for PublicKeyToken, Version and other info.

So, to recap:
Apparently, Visual Studio 2005 uses the Machine.config when you are running the "Data Source Configuration Wizard" to generate a data connection for Server Explorer's Data Connections.

Here's a copy of my missing entry:
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Also, I actually never got a notification about your reply even though I had "Alert Me" set up. Strange, I only signed on to update this issue with what I did to fix it.

jc3

|||

this didn't work for me... no matter what I try, I cannot get the database to connect from the designer!! I've installed the RC1 but when I go to add a new connection, there's nothing there for the compact/mobile edition :( any ideas what's going on? that entry is in my machine.config, but instead of microsoft.sqlserverce.clinent it's system.data.sqlserverce which is the right name for the dll file...

-SelArom

|||1. Install VS2005
2. Install VS2005 SP1 Beta
http://www.microsoft.com/downloads/details.aspx?FamilyID=8d702463-674b-4978-9e22-c989130f6553&DisplayLang=en
3. Install SQL Server Ce
4. Install SQL Server CE tools

Then you can open up a project and add a .sdf file (say Northwind) when the Data Source Configuration Wizard will auto start.|||

tools will not install! it says that I don't have the right version to be updated?!! what is that all about? I did install vs 2005, then sp1 beta then ce... now as I try tools it gives me that error... wtf?

-SelArom

|||

okay here is the exact error message:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade path.

I don't know what else I can verify, as I have installed visual studio 2005 and SP1, then Sql Server Compact Edition RC1. So what gives?

-SelArom

|||

Has anyone been able to resolve the issue surrounding the above error message, when attempting to install the "SQL Server Everywhere Tools for Visual Studio."

I get the same error message attempting to install the beta Toolset. Note that I am attempting to install the Tools on top of the just-released Visual Studio 2005 Service Pack 1 (not the beta as is specified in the instructions).

Any words of wisdom would be very helpful.

Thanks, Rob V

|||Adding the entry in Machine.config works fine for me, thanks!|||

I faced the same issue, however in my machine.config the entry was not missing but preceeded by another one.

<add name="SQL Server Everywhere Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Commenting or deleting the first one solves the problem.

No comments:

Post a Comment