none
System.Data.SqlServerCe Missing in \.NETFramework\v4.0

    Question

  • Hi,

    I am trying to install SQL Compact Edition on Windows 7 desktop Home Edition.  I am using visual studio C# 2010 Express Edition and have SQL Express 2008

    When I add "using System.Data.SqlServerCe", SqlCeConnection, isn't referenced.  I cannot find/add System.Data.SqlServerCe as a .NET reference.  When I navigate to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0.  SqlServerCe isn't present.  However, I can find the necessary file within

    C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private
    System.Data.SqlServerCe.dll
    System.Data.SqlServerCeEntity.dll

    C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private\x86
    sqlceca40.dll
    sqlcecompact40.dll
    sqlceer40EN.dll
    sqlceme40.dll
    sqlceqp40.dll
    sqlcese40.dll

    When I add a reference to C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private\System.Data.SqlServerCe.dll, SqlCeConnection, turns blue and is refereced.  But when I try to debug/run the application I get the message: 

    System.Data.SqlServerCe.SqlCeException was unhandled
      Message=Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8402. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.  I downloaded SSCERuntime-ENU.exe and have ran SSCERuntime_x86-ENU.exe and SSCERuntime_x64-ENU respectively. 

    My question is, what must I do to get SqlServerCe to be installed/registared within .NetFrameWork 4.0?  TIA

    Sunday, September 19, 2010 11:13 PM

Answers

  • I realized my issue.  When I downloaded visual C#, I didn't download SQLExpress Edition at that time.  I did download SQL Express 2008 R2, but as a seperate download.  I thought downloading the full SQL Express was enough, wrong.  I re-installed Visual Studio C sharp and included SQL Express in the download.  After the install, I was able to view SqlServerCe in the .NET framework.  Now, when I type using System.Data.SqlServerCe it is referenced correctly.   Thanks
    • Marked as answer by nshifter Monday, September 27, 2010 3:06 AM
    Monday, September 27, 2010 3:05 AM

All replies

  • I found that someone else had this problem too.  My issue is that I don't have "System.Data.SqlServerCe" offered under "Add reference - .NET".

     

    Their comment and solution, "The problem was that I added the reference to System.Data.SqlServerCe by
    using the option "Add Reference - Browse" and browsing to the SQL CE 3.5
    installation folder (C:\Program Files\Microsoft SQL Server Compact
    Edition\v3.5\Private), instead of using the "System.Data.SqlServerCe "
    offered under "Add reference - .NET".

    Once I changed the reference, I was able to access my database."

    Monday, September 20, 2010 2:15 AM
  • I realized my issue.  When I downloaded visual C#, I didn't download SQLExpress Edition at that time.  I did download SQL Express 2008 R2, but as a seperate download.  I thought downloading the full SQL Express was enough, wrong.  I re-installed Visual Studio C sharp and included SQL Express in the download.  After the install, I was able to view SqlServerCe in the .NET framework.  Now, when I type using System.Data.SqlServerCe it is referenced correctly.   Thanks
    • Marked as answer by nshifter Monday, September 27, 2010 3:06 AM
    Monday, September 27, 2010 3:05 AM