Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default value (null) for int data
Message
From
07/04/2008 14:10:48
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01308785
Message ID:
01308796
Views:
9
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform