Iterate over an objects properties

  • Thread starter Thread starter wapsiii
  • Start date Start date
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
 
Take a look at oUser.GetType().GetProperties(...) (or something like that).
 
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

Back
Top