Hi,
I have the following code but am having problems using null dates as optional parameters in a function. See below...
The error is with this part:
The error message displayed says 'Optional parameters cannot have structure types'. Any ideas what I need to do here? If no date parameter is passed I want to pass null or nothing.
I have the following code but am having problems using null dates as optional parameters in a function. See below...
Code:
Public Shared Function SendMail(Optional ByVal o As User = Nothing, Optional ByVal configid As Integer = Nothing, Optional ByVal dob As Nullable(Of DateTime) = Null, Optional ByVal email As String = Nothing) As User
Return UserData.SendMail(o, configid, dob, email)
End Function
The error is with this part:
Code:
Optional ByVal dob As Nullable(Of DateTime) = Null
The error message displayed says 'Optional parameters cannot have structure types'. Any ideas what I need to do here? If no date parameter is passed I want to pass null or nothing.