sdf file on non-CF generated code.

Posts   
 
    
bvalle
User
Posts: 54
Joined: 07-Jun-2006
# Posted on: 05-Jun-2007 01:59:40   

Hello

Using LLBLGen 2.0.0.0 Final - Adapter - .Net 2.0

Can I connect to a sdf file using the .Net 2.0 generated code? Or do I have to have the CF generated code to connect to .sdf SQL CE file?

Please let me know.

Thank you, BV

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jun-2007 09:10:11   

Please try the following:

  • Read the catalog from a standard SQL Server into the LLBLGEN Designer.

  • Generate the code for normal sqlserver.

  • Recompile the SqlServerCE DQE and modify the code a bit so it references the normal .NET assemblies, and has the same assembly name as the normal DQE so you can use the SqlServer templates.

  • Use the modified DQE all over the place instead of the normal SQLServerDQE.

  • Use the ORMSupportClasses for the standard .NET 2.0 framework.

bvalle
User
Posts: 54
Joined: 07-Jun-2006
# Posted on: 05-Jun-2007 17:46:20   

Please forgive me ignorance, but what is DQE?

And when you say "- Use the modified DQE all over the place instead of the normal SQLServerDQE." do you mean to go inside the generated code and modify this manually?

I have been generating code from a normal SQL 2005 database, and I have a database with the exact same schema on SQL CE. So when I do my DataAccessAdapter I use the "data source = .\Data\Database.sdf" with generated code for W32 would this work?

I am not quiet sure I understand your instructions. You are asking me to generate code using the CF compile and then go in and change the assemblies that this will reference to the normal .Net 2.0 dll?

Thank you again for your attention. BV

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Jun-2007 11:50:06   

I think you can't read .sdf files, or connect to these files, without using a driver or rdbms system.

Are you using windows ce or SqlServer CE on xp/vista? I assumed the later is the case. (SQLServer CE on XP/Vista).

Walaa said:

  • Generate the code for normal sqlserver.

When you generate the code for normal SQL Server, the generated code references some LLBLGen Pro libraries, one of the is the SQLServerDQE. (refer to the manual "Using the generated code -> Compiling the code")

Walaa said:

  • Recompile the SqlServerCE DQE and modify the code a bit so it references the normal .NET assemblies, and has the same assembly name as the normal DQE so you can use the SqlServer templates.
  • Use the modified DQE all over the place instead of the normal SQLServerDQE.

Now you have the SQLServerDQE library referenced from your generated code, but we don't want to use it, we want to use the SQLServerCE DQE, and since the source code of all these libraries is available to you (<LLBLGenPro Installation Folder>\RuntimeLibraries\Sourcecode). So we need to recompile the SQLServerCE DQE which knows how to deal with SQL Server CE, and to let it reference .NET libraries rather than the Compact Framework ones, and then let it have the assembly name of the normal SQLServerDQE assembly. Since we are going to reference it instead of the one being referenced already, so the main idea is to let it look like the normal DQE and make it use .NET libraries since it's supposed to work on windows xp/vista rather than the CF.