MaxValueRuleArgs limitation for Strings

MaxValueRuleArgs limitation for Strings

Old forum URL: forums.lhotka.net/forums/t/3781.aspx


MarkD posted on Thursday, October 25, 2007

Hi guys,
I'm trying to create a validation rule for MaxValue for a string datatype. I'm trying to use the MaxValueRuleArgs(Of T), but this doesn't work with Strings because:

"Overload resolution failed because no accessible 'New' is most specific for these arguments:
    'Public Sub New(propertyName As String, maxValue As String, format As String)': Not most specific.
    'Public Sub New(propertyName As String, friendlyName As String, maxValue As String)': Not most specific.
"

I saw Rocky talked about this during the 2.1 days here and I understand why he did it, but is there any other way to invoke this MaxValueRuleArg for a string? I suppose I could use the RegEx or write my own, but I was looking for a simple solution.

MD

MarkD replied on Thursday, October 25, 2007

Nevermind, I found the solution:

o = New MaxValueRuleArgs(Of String)(_propertyName, _friendlyName, MaxValue:=_max)

Copyright (c) Marimer LLC