Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Knowing if a property exists
Message
From
02/03/2011 09:23:06
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01502282
Message ID:
01502337
Views:
36
>I'm not entirely clear about what you want to achieve (or why you would *not* want the compiler to reject invalid fields) but setting Option Strict Off and casting to Object will stop the compiler complaining. You would then need to catch attempts to use invalid properties:
Dim oProcess As Object = New Something()
>        Try
>            Dim s As String = oProcess.oLabel.oCity
>            'OK
>        Catch ex As Exception
>            ' No such property or field
>        End Try
Ok, thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform