Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 12, 2008 07:50 PM by mattbriggs
Jun 12, 2008 06:35 PM|LINK
I may be a little late to this thread but the same issue has been driving me crazy. My confusion was componded by the C# to VB converter I used.
It translated the Metadata line as:
This shows as incorrect with ContactMetadata flagged as the wrong type for the expression.
I finally realized that the problem is that GETTYPE exists in more than one namespace. Type.GetType requires a string argument, e.g. "System.String". However there is also a gettype in the system.object namespace that accepts an object
Thus the correct syntax is:
Took me a whole day to figure is this out.
VB metadata gettype
Jun 12, 2008 06:42 PM|LINK
I think the correct VB syntax is simply GetType(ContactMetadata). It's not really calling a method, but it's more of a keyword, which matches typeof() in C#.
Jun 12, 2008 07:50 PM|LINK
I would HIGHLY recommend learning at least enough C# to translate code snippits on the web. This page has helped me alot coming from the other direction, when I have had to touch VB.net apps in the past.