G
Guest
I have an object with 30+ exposed properties. How can I, based on a string
input, retrieve the value of a specific property?
Here's what I'm doing right now:
Function GetField(ByVal FieldName as String) as String
Select Case FieldName
Case "Field1" Return myObj.Field1
Case "Field2" Return myobj.Field2
END Select
End Function
There's got to be a better way then this. Is Reflection what I'm after?
input, retrieve the value of a specific property?
Here's what I'm doing right now:
Function GetField(ByVal FieldName as String) as String
Select Case FieldName
Case "Field1" Return myObj.Field1
Case "Field2" Return myobj.Field2
END Select
End Function
There's got to be a better way then this. Is Reflection what I'm after?