Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

Iterate over an objects properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wapsiii - 19 Feb 2006 21:35 GMT
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
Peter Rilling - 19 Feb 2006 22:00 GMT
Take a look at oUser.GetType().GetProperties(...) (or something like that).

> From my database layer I get the object oUser.
>
[quoted text clipped - 6 lines]
>
> Mort
wapsiii - 19 Feb 2006 22:50 GMT
thanks :)

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

>Take a look at oUser.GetType().GetProperties(...) (or something like that).
>
[quoted text clipped - 8 lines]
>>
>> Mort

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.