Yes, I got it to work using prop.PropertyType.ToString.
To make sure I read only properties with printable values, I used, If NOT prop.PropertyType.isClass then . . .
That got me one step close.
Debug.WriteLine(prop.MemberType.ToString()) always returns "Property." What I need to know is if the data type of the property is a system type (system.integer, system.double, etc.) or is it a class or collection.
I am looping through all the properties of a class. Most are of a system data type (i.e. system.double, system.integer, etc.). Some are actually other classes. How can I tell at run time if the current property is a system data type or class or a collection?
Your welcome, Chrissie1. Watch out for one thing: if one of the properties is another object or collection, it won't be able to handle it. I'm working on it. Will post solution.
ANSWER:
Put this into any collection class, and it will loop through every object in the collection and print the value of each object.
The code between the ==== lines is the code that gets the value of the property.
Public Shared Sub PrintValues(ByVal ItemList As IEnumerable)
Dim...
I have a collection of objects. I can successfully loop through the collection, and print the value of any property by explicitly stating the property such as obj.ProductGID will print out the value of the current object's ProductGID property.
Looking for a way to print out the values without...
ca8msm,
No matter what I tried, I could not get anything but "GetType" to show in intellisense. BUT, this morning, after re-boot the computer, I get the full list of intellisense properties and methods. Mmmmm....... Maybe a problem with my Visual Studio 2003.
Anyways, thanks again for the...
Here is the exact code:
Dim dvPartsPricing As DataView
dvPartsPricing = dsPartsPricing.Tables(0).DefaultView
dvPartsPricing.Sort = "CatMainSubGID, Length"
OK. After two hours on Google I can not find an example to loop through a DataView the way I want to. Maybe its got something to do with Monday morning. Well, here is what I what to do:
For each row in dataview
For each col in dataview
debug.writeline(the current column)
Next
Next
Any...
Don't worry, SQLDenis. I, ispeaker, am really rrhandle who for some unknown reason have been unable to login for weeks, and no one will answer my e-mails, so I created a new account, and replied to this post to see what would happen.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.