Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Knowing if a property exists
Message
From
03/03/2011 11:15:24
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01502282
Message ID:
01502511
Views:
42
This seems to work:
Dim loFieldInfo As System.Reflection.FieldInfo = Nothing
Dim loMemberInfo As System.Reflection.MemberInfo() = Nothing

' Get a reference to the member
loMemberInfo = oProcess.oLabel.GetType().GetMember("c" + lcKey)

' If it exists
If loMemberInfo.Length > 0 Then

   ' Get a reference to it
   loFieldInfo = loMemberInfo(0)

   ' Get the property value
   loControlLabel.Text = loFieldInfo.GetValue(oProcess.oLabel)

End If
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform