Entity framework and SQL Compact
Hello,
I just upgrade my project to VS2008 SP1.
I regenerate my EDMX file which are pointing to a local SDF file (SQL Compact). Everything is working fine. But when i try to connect to using entity i get the following exception :
Message "The specified store provider cannot be found in the configuration, or is not valid." string
- InnerException {"Unable to find the requested .Net Framework Data Provider. It may not be installed."} System.Exception {System.ArgumentException}The provider is :
provider=System.Data.SqlServerCe.3.5
Any Clue ?
Thanks for your time.
Regards
Jeff
Answers
Ok i solve it (kind of). If i change platform to x86 instead of Any CPU it works.
So i the problem seems to be with x64 provider.
Thanks
Jeff
All Replies
Have you installed SQL Server CE? The inner exception is usually thrown if there is no such registered provider (in your case "System.Data.SqlServerCe.3.5").
Check C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config and look in the following section:
<configuration>
<system.data>
<DbProviderFactories>therere must be the following line:
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
edit:
I forgot to mention that you must have installed SQL Server Compact 3.5 SP1 Beta to work with the entity framework.
You can find more info at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2882695&SiteID=1
-Georgi
Hello Georgi,
Thanks for your reply.
Here is what i have in my machine config :
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.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"/>And yes i have the following tools installed :
Microsoft SQL Server Compact 3.5 SP1 design Tools English Beta
Microsoft SQL Server Compact 3.5 SP1 English Beta
Microsoft SQL Server Compact 3.5 SP1 for Devices English Beta
any other clue ?
Best Regards
Jeff
Ok i solve it (kind of). If i change platform to x86 instead of Any CPU it works.
So i the problem seems to be with x64 provider.
Thanks
Jeff
- I currently have a similar problem where I can't find the sql server compact data provider after installing sp1 beta. Where did you change the platform for compact to x86?
Thanks,
Dan Hello,
On VS2008, on the toolbar near the debug button, you have another drowpdown. Change the value of this dropdown from "Any Cpu" To x86.
Now it works for me.
Hope this help.
Regards
Jeff


