views:

61

answers:

2

I'm using LLBL in a solution for both MS SQL Compact and "regular" MS SQL 2008..

I'm wondering if it's ok to use the same DatabaseGeneric project (generated by LLBL) & reference it from the 2 DBSpecific projects (generated by LLBL) targeting different MS SQL server editions?

I'm planning to test it later, but the projects dependencies make the cost of trying this out pretty high.. It will be such a waste of time to try it & fail

Let me know if there's any other alternatives I might be missing out!

A: 

Unfortunately it doesn't that's simply because all the interfaces you might need to use are in

SD.LLBLGen.Pro.ORMSupportClasses.CF35
SD.LLBLGen.Pro.ORMSupportClasses.NET20

Like (SD.LLBLGen.Pro.ORMSupportClasses.)IEntity2, IEntityCollection2, etc

Thus you can't fetch, say, a (Compact Framework) ProductEntity using adapter.FetchEntity(productsEntity) as the adapter will be expecting a IEntity2 from the SD.LLBLGen.Pro.ORMSupportClasses.NET20 while you're providing one that implements IEntity2 from SD.LLBLGen.Pro.ORMSupportClasses.CF35

The DatabaseGeneric project isn't really that "Generic" :D

Shady M. Najib
+3  A: 

Different SQLServer versions are supported through the Compatibility Setting. See: http://bit.ly/92ojkL (online docs) which is the config file setting, or in code, by calling DataAccessAdapter.SetSqlServerCompatibilityLevel

You can set it to a compatibility mode of 7, 2000, 2005+, CE Desktop 3 or CE Desktop 3.5

COmpact framework requires different code so it's not addressable through the same .NET code, simply because it has to be compiled against a different mscorlib, has less classes (some code has to be excluded) and the DQE therefore is different.

I.o.w.: I also don't see why you'd want to fetch data on normal .NET from a compact framework located DB, as that's not possible. If you think about SQL Server compact desktop, that's supported as described above. So, yes, it IS generic, but not transportable to another .NET framework like the compact framework, which is logical, due to its nature of a limited api

Frans Bouma
I think the confusion here came from (if I understand right) the fact that SQL CE on desktop PC is different from SQL CE on Windows Mobile or so. I assume Shady wanted to use SQL CE on desktop as file based DB engine.
Mohamed Meligy
Shady M. Najib
Shady M. Najib
You can use the normal SQL Server vs.net project for the CE Desktop db, and use the CF vs.net project for the mobile part. So you don't need 3, just 2. Unfortunately, it can't be 1, as I said, the code has to be compiled against a different .net version, and you can't share that, MS wasn't that clever... :(
Frans Bouma