Dynamic retrieval of entity field value(s)

Posts   
 
    
stoneyowl avatar
stoneyowl
User
Posts: 62
Joined: 29-Jan-2004
# Posted on: 14-Apr-2005 23:27:20   

Suppose I have an entity with several fields (Name, SSN, Rank, DOB, etc). Is it possible to retrieve the value of a field given the (user supplied) field name? IE I want to do something like this:


string fieldname = txtFldName.Text; 
string data = mBioData.GetFieldData(fieldname);

stoneyowl avatar
stoneyowl
User
Posts: 62
Joined: 29-Jan-2004
# Posted on: 14-Apr-2005 23:28:45   

Never mind. I found "GetCurrentFieldValue()' right after I posted.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-Apr-2005 09:07:36   

Or: entity.Fields[fieldname].CurrentValue simple_smile

Frans Bouma | Lead developer LLBLGen Pro