New Posts New Posts RSS Feed: Accessing a field through a variable
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Accessing a field through a variable

 Post Reply Post Reply
Author
BillG View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 05-Dec-2007
Location: Monroe, MI
Posts: 233
Post Options Post Options   Quote BillG Quote  Post ReplyReply Direct Link To This Post Topic: Accessing a field through a variable
    Posted: 16-Aug-2013 at 5:33pm
let's say i have an object called member. It repesents the members table. In the object called member, i have a property called LastName. Now I have in my code i have assigned the string "LastName" to a variable
 
var fieldName = "LastName"
 
How do i retrieve the value of the LastName property from the member object using the fieldName string.
 
var lastName = member?????? fieldName;
 
 
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 16-Aug-2013 at 8:29pm
This should do the trick:

EntityAspect.GetValue(variableName); 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down