Combine fields for drop down list

Posts   
 
    
lgege
User
Posts: 27
Joined: 01-Sep-2005
# Posted on: 01-Sep-2005 00:56:13   

Hi,

How could I combine two fields. e.g. firstname + lastname, for a dropdownlist. The equivalent sql statment is like Select Column1+Column2 from Table

Thanks.

Emmet
User
Posts: 36
Joined: 12-Jul-2005
# Posted on: 01-Sep-2005 01:10:22   

We've started addeding custom properties to the user code regions in then enitity classes.

For example:


// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
public string FullName
{
          get{return this.FirstName + " " + this.LastName;}
}
// __LLBLGENPRO_USER_CODE_REGION_END

From there you should be able to databind the item.

Cadmium avatar
Cadmium
User
Posts: 153
Joined: 19-Sep-2003
# Posted on: 01-Sep-2005 17:33:33   

For something common like FirstName + LastName you could also set up a Formula column in your table (assuming you're using Sql Server). Just create a column and in the Formula field put in something like


([FirstName] + '  ' + [LastName])

It will automatically be updated whenever you update either field, and it's readonly. Very handy.