Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Knowing if a property exists
Message
De
02/03/2011 09:23:06
 
 
À
02/03/2011 04:40:32
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01502282
Message ID:
01502337
Vues:
37
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform