Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

setting a property value using reflection

If the code below gets a property by constructing the property name how would i set it?

say i want to set the property availabilityMonth.Day07 = 12 for e.g?

how would i do that?

im trying something like:
dayAvailability.SetValue(_availabilityMonth, 2, Reflection.BindingFlags.SetProperty)

but not getting very far?
Dim dayAvailability As Reflection.PropertyInfo = Nothing
 
 dayAvailability = _availabilityMonth.GetType.GetProperty("Day" + monthDay.ToString())

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of omegaomega
omegaomega
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml
scm0sml

ASKER

good man.