Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Embedding SQL Server CE 3.5
 

Pages: 1
LLBLGen Pro Runtime Framework
Embedding SQL Server CE 3.5
Page:1/1 

  Print all messages in this thread  
Poster Message
pandu
User



Location:

Joined on:
18-May-2006 07:20:06
Posted:
86 posts
# Posted on: 02-May-2009 12:38:22.  
Hi:

I am developing a Desktop application using SQL Server CE 3.5 Database.

I have created the SQL Project to generate the code and changed the connection string in app.confing and set the compatibility to 4.

My requirement is that the client computer should use the CE 3.5 database without installing SQL Server CE 3.5.

When I launch the application, I get this error:

Code:
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine' threw an exception. ---> SD.LLBLGen.Pro.ORMSupportClasses.ORMGeneralOperationException: There's no ADO.NET provider defined / found for the compatibility level 'SqlServerCE35'. Please make sure either the machine.config or this application's .config file contains a definition of the provider.
at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.SetFactoryToUse()
at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.set_CompatibilityLevel(SqlServerCompatibilityLevel value)
at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine..cctor()
--- End of inner exception stack trace ---
at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine..ctor()
at ES.ABC.DAL.DatabaseSpecific.DataAccessAdapter.CreateDynamicQueryEngine() in D:\ABCDAL.CE\DatabaseSpecific\DataAccessAdapter.cs:line 458
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateSelectDQ(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfoObjects, IPredicateExpression filter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollectionInternal(IEntityCollection2 collectionToFill, IRelationPredicateBucket& filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket)
at ABCClient.BusinessLayer.XManager.FetchXCollection() in D:\Projects\ABCClient\ABCClient\BusinessLayer\XManager.cs:line 65
at ABCClient.frmMain.SetGlobalYCode() in D:\Projects\ABCClient\ABCClient\frmMain.cs:line 89
at ABCClient.frmMain.frmMain_Load(Object sender, EventArgs e) in D:\Projects\ABCClient\ABCClient\frmMain.cs:line 76
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


I do build LLBL Dlls outside of the project and reference them in my application. When I build the LLBL Dlls, Do I need to reference any DLLs for CE support, so the application runs without installation of SQL Server CE 3.5 in client machine?

Thank you for your help.

PS: When I install SQLServer CE 3.5 in client's workstation, it works just fine. Regular Smiley

  Top
pandu
User



Location:

Joined on:
18-May-2006 07:20:06
Posted:
86 posts
# Posted on: 02-May-2009 12:46:19.  
Code:
SqlServerCe provider registration
It's no longer necessary to reference System.Data.SqlServerCe.dll, however on the machine the application is ran which uses compatibility level 3 or 4, this dll has to be installed as documented in the SqlServer CE Desktop documentation about deployment: via the .msi shipped with SqlServer CE Desktop. If you can’t run this .msi installer, be sure your application’s .config file contains the appropriate provider registration for the DbProviderFactory. (this information is installed in the machine.config file by the .msi installer of SqlServer CE Desktop). More details about this are available in the SqlServer CE Desktop documentation (the 'Books online' documents of SqlServer CE Desktop)


Based on the above info, I have even included the System.Data.SqlServerCe.dll in the application and it is installed when installing the application. But it doesn't help.

Thanks.



  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8150 posts
# Posted on: 03-May-2009 22:29:04.  
This is copied from the manual:
Quote:
SqlServerCe provider registration
It's no longer necessary to reference System.Data.SqlServerCe.dll, however on the machine the application is ran which uses compatibility level 3 or 4, this dll has to be installed as documented in the SqlServer CE Desktop documentation about deployment: via the .msi shipped with SqlServer CE Desktop. If you can’t run this .msi installer, be sure your application’s .config file contains the appropriate provider registration for the DbProviderFactory. (this information is installed in the machine.config file by the .msi installer of SqlServer CE Desktop). More details about this are available in the SqlServer CE Desktop documentation (the 'Books online' documents of SqlServer CE Desktop)


Also look at these related threads:
http://llblgen.com/tinyforum/Messages.aspx?ThreadID=13829
http://llblgen.com/tinyforum/Messages.aspx?ThreadID=12418
David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
pandu
User



Location:

Joined on:
18-May-2006 07:20:06
Posted:
86 posts
# Posted on: 05-May-2009 08:03:36.  
Quote:

http://llblgen.com/tinyforum/Messages.aspx?ThreadID=13829


This thread is close to what I was looking for.

This is what I did.

1. I have a external Dummy Web Application that has two LLBL Projects added and referenced to create the DLL to its Bin. At this point, I do not reference any SQLServer CE Dlls here.

2. In my Desktop Project, I have referenced the LLBL Dlls and SqlServerCe.dll and set the Build to "Content" and Copy Always. This ensure that the DLL is copied to my application root directory when installed. I even referenced all 7 Dlls from \Desktop directory of SQL Server CE directory installation and have set to copy to my app folder as well.

3. I have changed my app.config and it looks like this:

Code:
<configuration>
<appSettings>
    <add key="Main.ConnectionString" value="data source=C:\Data\TestCE.sdf"/>
    <add key="SqlServerDQECompatibilityLevel" value="4" />
</appSettings>

<system.data>
    <DbProviderFactories>
        <remove invariant="System.Data.SqlServerCe.3.5" />
        <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"/>
    </DbProviderFactories>
</system.data>

</configuration>


I build the project and installed in a Virtual PC which doesn't have SQLServer CE installed.

When I run the app, I get the same error.

What am I missing?

Confused


  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14639 posts
# Posted on: 05-May-2009 09:38:23.  
Take care of the version number:

Code:
<system.data>

<DbProviderFactories>

<remove invariant="System.Data.SqlServerCe.3.5" />

<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.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>

</DbProviderFactories>

</system.data>

Try this Version=3.5.1.0

  Top
pandu
User



Location:

Joined on:
18-May-2006 07:20:06
Posted:
86 posts
# Posted on: 05-May-2009 11:36:05.  
THAT did the trick.

Thanks a lot.

Laugh



  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.