I'm a C# programmer but am converting some code from C# to VB.NET. In c# I can simply use (int)blah.getValue()
where getValue()
returns an Integer?
Doing a DirectCast()
in VB.NET doesn't work though, saying Integer?
cannot be converted to Integer
.
Ideas?
Use the value property to get the actual integer value.
Dim intNullable As Integer?
If intNullable.HasValue Then
Return intNullable.Value
End If
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With