>I have a number of properties which are objects ( business objects )
>
>If I have string which is the same as the name of one of those properties I would like to find the value of a property of the corresponding object.
>
>in VFP
>
>*property is called _Propmaster
>
>varstr = "Propmaster"
>prop = "_"+varstr+".count"
>
>mycount = eval(prop)
>
>
>Looking for a technique that will accomplish the same thing in .NET
>
>vb or C#
>
>TIA
There are many ways to do things in .Net just like VFP:) One way would be to use TypeDescriptor class. ie:
PropertyDescriptor pd = TypeDescriptor.GetProperties( myObj ).Find( myProperty, true );
if (pd != null)
var value = pd.GetValue( myObj );
Cetin