Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent to eval()
Message
 
 
To
29/03/2010 20:08:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01457734
Message ID:
01458016
Views:
47
>>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

Thanks for the tip. But is SQL really antiquated? ;-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform