Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Designer> Why is it necessary to target CF when doing SQL Server CE?
 

Pages: 1
Designer
Why is it necessary to target CF when doing SQL Server CE?
Page:1/1 

  Print all messages in this thread  
Poster Message
JimFoye
User



Location:
Austin, TX
Joined on:
22-Jun-2004 04:03:11
Posted:
656 posts
# Posted on: 26-Aug-2009 22:46:26.  
I'm confused by this requirement. I can add System.Data.SqlServerCe assembly to my project and talk to a CE database with no problems. But it appears to me that to get LLBLGenPro to use CE, I must target the Compact Framework in my DAL projects. Why is that?

Confused
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8099 posts
# Posted on: 27-Aug-2009 05:54:42.  
If you are using SqlServer CE Desktop, you must use a non-CF platform:
docs wrote:
To be able to target SqlServer CE Desktop, you first has to create a SqlServer project, similar to what you have to do for CF.NET support. Then, you have to select .NET 2.0 or higher as the target platform at tab 1 on the Generator Configuration dialog. CF.NET 1.0/2.0 or .NET 1.x aren’t supported for SqlServer CE Desktop.

What SQlServer Ce version and LLBLGen version do you have?


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
JimFoye
User



Location:
Austin, TX
Joined on:
22-Jun-2004 04:03:11
Posted:
656 posts
# Posted on: 27-Aug-2009 21:21:12.  
3.5 sp1 and LLBLGenPro 2.6.

Ah, I was looking at this:

Quote:
To start with SqlServerCE, first create the project on a normal SqlServer 7/2000/2005 database, then generate code using that project and by selecting CF.NET 1.0, CF.NET 2.0 or CF.NET 3.5 in the platform combo box.


That's from the section "Compact Framework / Sql CE support" in the preface. But that's just explaining if I really do want to target CF + CE, I should be in "Generated code - Database specific features". OK, thanks.

But I did notice this in the generated file DatabaseAdapter.cs, and this helped throw me off, because it looks like CF has to be targeted to make LLBLGenPro use CE.

Code:

#if CF
using System.Data.SqlServerCe;
#else
using System.Data.SqlClient;
#endif


Am I still missing something? How does my DAL know that CE is the target if CF is not #defined?

  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14570 posts
# Posted on: 28-Aug-2009 11:32:25.  
Please read the following paragraph in the same Documentation section "Generated code - Database specific features"

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)


  Top
JimFoye
User



Location:
Austin, TX
Joined on:
22-Jun-2004 04:03:11
Posted:
656 posts
# Posted on: 28-Aug-2009 15:31:41.  
OK, thanks!
  Top
Pages: 1  


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

Version: 2.1.12172008 Final.