Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
Get Properties from object
March 15, 2011
i am having an object which contains properties/child objects etc. child objects also contains properties, i need to iterate through each properties. which is best method to use..?
Posted Date: March 17, 2011 Points: 20
hi friends i got the answer here is the simple code which iterates through each property useing reflection, for this if your objects contains child objects/ or child classes then you should know the root namspace for the child objects
Private Function GetObject(ByRef aoObjectToFound As Object, ByVal asObjectName As String, Byval asBaseClassNamspace as String) As Object
For Each oItems As Reflection.PropertyInfo In aoObjectToFound.GetType().GetProperties()
If oItems.GetValue(aoObjectToFound, Nothing) IsNot Nothing Then
If oItems.PropertyType.FullName.StartsWithasBaseClassNamspace) Then
If oItems.Name = asObjectName Then
Return oItems.GetValue(aoObjectToFound, Nothing, asBaseClassNamspace)
GetObject(oItems.GetValue(aoObjectToFound, Nothing), asObjectName)
To post reply
Related Questions Related Questions
Error in Web Setup Project while using Installer Class aError in Web Setup Project while using Installer Class and Custom Actions "Object reference not set to an instance of an object"nd Custom Actions "Object reference not set to an instance
how to implement expandable and collapsible properties for usercontrol?
What is Object pooling in ASP.NET.
Mobile Application CSS and Table properties problem in Nokia
what are methods of response object?
creation of object
How to send Flash object to back of other object
To drop an instanse of an object?
How to drag and move an object using silverlight?
Latest Forum Questions From The Same Category
Slash(/) in Combobox
attaching the report in the web page
How do i get payment status in redirect page using bitpay?
Login with Facebook and Save details in database
Login with facebook account in my website
How to make a nested datalist control?
What class does Icon derive from?
What are the validation controls?
What''s the difference between an interface and abstract class?
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend