In Visual Basic.NET ULong.MaxValue=18,446,744,073,709,551,615.
The following code runs fine:
Dim a As ULong = ULong.MaxValue
The following code returns an overflow error on the number
Dim b As ULong = 18446744073709551615
What is causing this error?
The compiler assumes that any whole number too large to be an
Integeris aLongand of course your number won't fit in aLong. You need to add the UL suffix to the literal number to indicate that it isULongand not justLong.