0

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!

Shady M. Najib
  • 2,151
  • 2
  • 19
  • 30

2 Answers2

3

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
  • 8,259
  • 1
  • 27
  • 28
  • 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. – Meligy Aug 15 '10 at 10:37
  • Actually, my case is as Meligy Described & I was just wondering if only all the interfaces where in a separate dll. The issue is I'm already using (generated) LLBL projects for .Net "regular" framework, and for Compact Framework (for Windows Mobile app). But at some point I needed to access a CE SQL DB (sdf) from windows forms app before moving it to the mobile device. – Shady M. Najib Aug 16 '10 at 00:50
  • I was looking for a work around for using the CF LLBL project to do that instead of generating a third time for the SQL CE desktop version (having three pairs of projects in my solution sounds a bit dull to me, the solution is already too big, not to mention the confusion of having "almost" the same project again & again) – Shady M. Najib Aug 16 '10 at 00:51
  • 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 Aug 16 '10 at 08:10
0

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
  • 2,151
  • 2
  • 19
  • 30