PsychoCoder
Programmer
I have a function Im creating:
The DateTime.Today.ToShortDateString for the default value of the Optional parameter is telling me "Constant expression is required". Im trying to use the current date as the default value if the user doesnt specify one.
Code:
Public Shared Function GetErrors(ByVal lbl As Label, Optional ByVal type As Integer = 1, Optional ByVal dDate As DateTime = DateTime.Today.ToShortDateString, Optional ByVal eType As Integer = 1, Optional ByVal status As Integer = 1)
The DateTime.Today.ToShortDateString for the default value of the Optional parameter is telling me "Constant expression is required". Im trying to use the current date as the default value if the user doesnt specify one.