Iterate over an objects properties

W

wapsiii

From my database layer I get the object oUser.

How do I iterate over every property in oUser?

something like
for each prop as oUserProperty in oUser.Properties
do something...
next

Mort
 
W

wapsiii

thanks :)

Dim prop As System.Reflection.PropertyInfo
For Each prop In uu.GetType.GetProperties()
name = prop.Name
value = prop.GetValue(uu, Nothing)
Next prop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top