How can I exclude columns from code generation!

Posts   
 
    
Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 06-Nov-2006 16:31:18   

Hi,

I have the following problem:

Sql Server 2005 / Sql Server 2005 Mobile. I use mergereplication (I want to use) but we have a lot of tables, they have more than 127 columns. But the limit to replicate is 127 columns. I can exclude the columns from replication but when I use the generated code on my PPC, an error occurs because the columns are not in the replicated database (SDF) on the device.

I don´t want to maintain a new database structure! And I don´t need the columns for the application on the device.

How can I solve that issue?

I am using LLBLGen 2.0, 13th Sep 2006 and the latest templates & runtime libraries.

Regards, Carlo

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 06-Nov-2006 16:39:03   

Hi,

in LLBLGen, you right clic on your entity and clic Edit/Properties. The you choose the "Entity Fields" Tab on here you can delete the columns you don't need for your objects on your ppc. After that, you can keep only the columns you will have in your database and not all the current columns.

Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 06-Nov-2006 23:12:27   

Thank you for your reply (it is nearly what I was looking for).

I have looked before in the entity edit section, but I have overlooked the remove button flushed In that moment it works for me. But now I have to maintain two LLBLGEN projects disappointed

I was realy lucky, that I can generate both projects (desktop, ppc) within one LLBLGEN project. Maybe it is a new issue for upcoming versions simple_smile

It would be very helpful if it is possible to exclude/include columns for different targets (.NET 2.0, CF 2.0 etc.). If there are some changes in the database structure, I have only to maintain one project - if you know what I mean smile

Regards, Carlo

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 07-Nov-2006 10:38:27   

You can't exclude fields in one generation cycle and not in the other one, so either use two projects or sync the schema. I'd use two projects though, unless you are using the same client code on both systems.

Frans Bouma | Lead developer LLBLGen Pro
Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 08-Nov-2006 01:17:41   

You can't exclude fields in one generation cycle and not in the other one

Why not? It depends on the underlying BL or I am wrong? Normaly I don´t need the whole data on my ppc (the device would explode frowning ). And in my case it isn´t possible, because of the column limitation for the merge replication(127 columns) on the sqlserver ce 3.0 version.

On server-side (desktop), I don´t care about the amount of columns (yet) wink

Regards, Carlo

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 08-Nov-2006 08:07:29   

I think you might be able to do this by creating an Add-In to the LLBLGen Pro Designer. Please consult the LLBLGen Pro SDK.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 08-Nov-2006 09:25:21   

Rushmore wrote:

You can't exclude fields in one generation cycle and not in the other one

Why not? It depends on the underlying BL or I am wrong?

It's because of entity definitions. An entity E has 10 fields, so that's the entity definition to work with. During code generation, that entity with its 10 fields is used as a read-only source for the output. So modifying E to have 5 fields instead of 10, alters the entity.

Another possibility could be to add all entities again, with a suffix (i.e. CustomerCE) and make 2 subsets when generating code (you can do that on tab 1 of the generation configuration dialog). Of course, this won't work if you use the same client code on ppc and normal .net

Frans Bouma | Lead developer LLBLGen Pro