Table field name

Posts   
 
    
Stoop
User
Posts: 66
Joined: 28-Feb-2004
# Posted on: 06-Mar-2005 10:00:10   

Hi

Probably a dumb question, but I can't seem to hit on how to do it...

How does one get the original source table field name as a string?

What I mean is this: In SQL Server there is a field named, for example, "Customer_FN". In LLgen, this is given the field name in the designer "CustomerFirstName". I need in my code access to the string value "Customer_FN"...

Thx Steve

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 06-Mar-2005 10:59:28   

In selfservicing, you do: string fieldName = entity.Fields["CustomerFirstName"].SourceColumnName;

In adapter, you have to derive a class from DataAccessAdapter, add a method there which accepts an entity field and call base.GetFieldPersitenceInfo(field), which returns a IFieldPersistenceInfo object, which also has a SourceColumnName property.

Frans Bouma | Lead developer LLBLGen Pro