>For lurkers, I thought I'd post my results :
>
>this technique works for public properties and works well.
>
>Here's the VB version of what I did
>
>We are asssuming there are a dozen public properties of type BaseBO
>Based on a string we are going to find out the number of records in that BO
>(the actually string is derived from evaluating the displayvalue of an enum at run-time)
>
>
>Dim childname as string = "GL"
>Dim childbo as Basebo
>Dim pd As PropertyDescriptor = _
>TypeDescriptor.GetProperties(Me).Find(childname, True)
>
> If Not IsDBNull(pd) Then
> childbo = CType(pd.GetValue(Me), BaseBO)
> childcount = childbo.Count
> End If
>
>
>Thanks Cetin
>
>(the function Michel posted is very useful when the BO is assigned to a private variable instead of a property )
Birsey degil:)
BTW download LinqPad 4 from
www.linqpad.net if you haven't already. It simply rocks. Watch webcast for a peek of new features (you can even do interactive VB there although biased to C#:)
Cetin