Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method overload requires Public declaration
Message
De
07/05/2011 18:14:27
 
 
À
07/05/2011 02:11:44
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:
01509881
Message ID:
01509980
Vues:
43
>That sounds like a gotcha in the VB implicit conversion rules with Option Strict OFF. If you have two overloads (one accepting a string and the other an integer) and attempt to call that function with a decimal value as the parameter then the compiler doesn't know whether it should implicitly convert to a string or an integer (ie which overload to use). You should cast to the type you wish to use prior to the call.
>(In C# the same construct would give the usual 'invalid argument' error).
>But I'm not sure why you saw this only at runtime - the compiler should catch it?

That is exactly that. Since I added an overload for a double last night, it started to work.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform