DB Default values

Posts   
 
    
Liero
User
Posts: 40
Joined: 18-Sep-2009
# Posted on: 29-Oct-2009 12:10:30   

I'm using DynamicData with LLBL and in the insert page templates I want to preselect fields values by DB default values. I can get default values from DB like SELECT COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '[tableName]'

but its return only string representation of the value. value of type varchar(3) is for example N'Eur'.

As written here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=988

DB default value is in project file, but I don't know how to generate from it typed EntityField's property

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-Oct-2009 21:54:47   

You can't as it stands read it from the generated EntityFields property.

You can in an .lpt template read the TARGET field of an entity field (thus the field the entity field is mapped on) which has a property called DefaultValue, that's the value read from the meta-data.

Please check the project inspector plugin in v2 designer and the sdk reference manual.

Matt