Dynamic List, create a field that just contains an integer

Posts   
 
    
Darren166
User
Posts: 41
Joined: 30-Jan-2007
# Posted on: 03-May-2007 18:49:41   

Hi,

hopefully a simple question, but one which I can't track down an answer for.

I have created a dynamic list and want to add a field that just has a constant for a value, e.g. in the select statement it appears as

SELECT 0 AS DummyField, ... other fields .. FROM ....

how do I do this using fields.DefineField ? As a dirty workaround I am subtracting one field from another using an expression.


fields.DefineField(new EntityField("DummyField", ProductFields.StatusId - ProductFields.StatusId), 0);

What I was hoping for was something along the lines of


fields.DefineField(new EntityField("DummyField", 0), 0);

Thanks in advance,

Darren

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-May-2007 01:18:13   

Hi Darren. Pasted from LLBLGenPro Help - Using the generated code - Field expressions and aggregates

The different types of expressions you can produce are:

Field Field ExOp Field Field ExOp Value Field ExOp Expression Value ExOp Field Value ExOp Expression Expression ExOp Field Expression ExOp Expression Expression ExOp Value

So I think is no an obvious way to do that disappointed

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39918
Joined: 17-Aug-2003
# Posted on: 04-May-2007 10:06:13   

You can also add a column to the datatable and add the value there.

Frans Bouma | Lead developer LLBLGen Pro
Darren166
User
Posts: 41
Joined: 30-Jan-2007
# Posted on: 04-May-2007 11:58:24   

Of course!

Thanks Frans, sometimes you look so closely at something you forget the bigger picture!

Darren