Ask a questionAsk a question
 

AnswerEntity framework and SQL Compact

  • Friday, May 30, 2008 4:16 PMJeff750666 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    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

  • Tuesday, June 03, 2008 1:15 PMJeff750666 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

  • Monday, June 02, 2008 8:56 AMg_yordanov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

  • Monday, June 02, 2008 4:09 PMJeff750666 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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

     

  • Tuesday, June 03, 2008 1:15 PMJeff750666 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

     

  • Thursday, June 05, 2008 8:25 PMdanng123 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Friday, June 06, 2008 6:44 AMJeff750666 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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