Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default value (null) for int data
Message
De
07/04/2008 14:10:48
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01308785
Message ID:
01308796
Vues:
8
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>I have the following method signature:
>
> public List<MembershipUserWrapperForMP> GetMembers(bool approvalStatus, string sortData, string ExcludeRole, int SiteID)
>
>I want to be able to call it without 3 last parameters (they should be optional).
>
>However, this declaration:
>
>
>[DataObjectMethod(DataObjectMethodType.Select, false)]
>        public List<MembershipUserWrapperForMP> GetMembers()
>        {
>            return GetMembers(true, true, null, null, null, null);
>        }
>
>produces the following error:
>Error 103 Argument '6': cannot convert from '' to 'int'

Make the int nullable:
public List<MembershipUserWrapperForMP> GetMembers(bool approvalStatus, string sortData, string ExcludeRole, int? SiteID)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform