none
Deploying SQLCE 3.5 RRS feed

  • Question

  • I'm trying to deploy SQL CE with my app and I want to use the Xcopy of dlls method.

    So From what I understood I need to include all the sql dlls in the output app directory plus the System.Data.SqlServerCe.dll file. However, after installation my app still doesn't seem to use the dlls and acts  as if the files dont exist.

    What i do is just copy and paste the sql ce dlls in the Application Folder of the setup project, so after the install all the files are in the app directory which I checked. But what am I missing here?

    I followed the steps in this link:

    http://msdn.microsoft.com/en-us/library/aa983326%28v=vs.80%29.aspx


    Garejoor.com
    Monday, September 5, 2011 10:38 PM

Answers

All replies

  • See this blog post: http://erikej.blogspot.com/2011/02/using-sql-server-compact-40-with.html and http://msdn.microsoft.com/en-us/library/ms173298.aspx (but name the folder AMD64, not x64)
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Marked as answer by Garejoor Wednesday, September 7, 2011 6:25 PM
    • Unmarked as answer by Garejoor Thursday, September 8, 2011 1:01 AM
    Tuesday, September 6, 2011 9:39 AM
    Moderator
  • Thanks Erik,

    following the procedure from the second link (i'm using Sql CE 3.5) I managed to get the sql ce libraries working fine, but now I'm getting this error?

     

    System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
       at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
       at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
       --- End of inner exception stack trace ---
       at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
       at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
       at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
       at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
    

     

    here is the list of assembilies that do get copied after an install:

    • System.Data.SqlServerCe.dll
    • x86
    •  - sqlceca35.dll
    •  - sqlcecompact35.dll
    •  - sqlceer35EN.dll
    •  - sqlceme35.dll
    •  - sqlceoledb35.dll
    •  - sqlceqp35.dll
    •  - sqlcese35.dll
    •  - System.Data.SqlServerCe.Entity.dll
    • and others that are specific to app.

    my entity conenction string is this:

    res://*/Database.WMON_DBModel.csdl|res://*/Database.WMON_DBModel.ssdl|res://*/Database.WMON_DBModel.msl; Provider=System.Data.SqlServerCe.3.5;provider connection string=""{0}""", Data Source = "ss"; Password="dd");

    And My app is using .NET 4.0.

    What assemblies are missing from the dir output?

    Thanks,

     

     


    Garejoor.com
    • Edited by Garejoor Tuesday, September 6, 2011 7:03 PM
    Tuesday, September 6, 2011 7:02 PM
  • Have you modified your app.config as described in my blog post?

     

    <system.data>
        <
    DbProviderFactories>
          <
    remove invariant="System.Data.SqlServerCe.3.5"/>
          <
    add name="Microsoft SQL Server Compact Data Provider 3.5" 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.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
        </
    DbProviderFactories>
      </
    system.data>


    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Edited by ErikEJMVP, Moderator Wednesday, September 7, 2011 6:42 AM
    • Marked as answer by Garejoor Wednesday, September 7, 2011 6:25 PM
    • Unmarked as answer by Garejoor Thursday, September 8, 2011 1:01 AM
    Wednesday, September 7, 2011 6:42 AM
    Moderator
  •  

    Actaully it didn't completly work correctly. Now I'm getting this error message:

    "error 0004: Could not load System.Data.SqlServerCe.Entity.dll. Reinstall SQL Server Compact."

    googling it and following the steps on a website (http://www.codeproject.com/KB/database/SQLCEPrivateInstallation.aspx) caused it to crash at a higher level.

    What could this be?

     

    It worked! Thanks Erik. I owe you twice now! I dont know how to repay.

    I dont understand why are you removing the SqlServerCe.3.5 and adding the same one? It sure worked though.


    Garejoor.com
    • Edited by Garejoor Thursday, September 8, 2011 1:03 AM
    Wednesday, September 7, 2011 6:25 PM
  • ;Move the Entity DLL one level up (from the x86 folder), and you might also have to refer to this blog post: http://blogs.msdn.com/b/sqlservercompact/archive/2010/05/12/troubleshooting-problem-with-private-deployment-of-sql-server-compact-3-5sp2-entity-dll.aspx (This has improved in 4.0)
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Proposed as answer by Imran Siddique [MSFT] Thursday, September 8, 2011 5:44 PM
    • Marked as answer by Garejoor Thursday, September 8, 2011 8:35 PM
    Thursday, September 8, 2011 6:47 AM
    Moderator