Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I iterate through class properties?

Status
Not open for further replies.

Arthur5

Programmer
Joined
Nov 3, 2006
Messages
1
Location
US
Hey guys,

I have a web service with 230 public properties named Value1, Value2...ValueN:

Public Class Person

Public Value1 As ValueN
...
Public Value230 As ValueN

End Class

Each ValueN is a structure:

Public Structure ValueN

Public Value As String

Public FieldName As String
Public FieldCaption As String
Public FieldType As String
Public FieldLength As String

Public Critical As Boolean
Public ValidationMessage As String

End Structure

How do I iterate through through these properties? Is there a better way to organize them like array and if so how do I iterate through these in web service and in consuming code?

Thanks a lot!
(my C# really sucks, please VB.NET )
 
I think you need to use Reflection to do this. Have a look in the help files and online for more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top