I am using VB.NET and I have a variable that is defined as Nullable(Of
Single) as follows:
Dim fMyNullableSing le as Nullable(Of Single)
Then, I have another variable as follows:
Dim fCumulativeExpe ctedAmt As Single = 0
When I make the following assignment:
fMyNullableSing le = fCumulativeExpe ctedAmt
the end result is that fMyNullableSing le is Nothing. So, later, when I
try to assign it to another non-nullable variable, it fails.For
example...
Dim fMyNonNullableS ingle as Single
fMyNonNullableS ingle = fMyNullableSing le
causes an Exception.
How do I correct this?
Single) as follows:
Dim fMyNullableSing le as Nullable(Of Single)
Then, I have another variable as follows:
Dim fCumulativeExpe ctedAmt As Single = 0
When I make the following assignment:
fMyNullableSing le = fCumulativeExpe ctedAmt
the end result is that fMyNullableSing le is Nothing. So, later, when I
try to assign it to another non-nullable variable, it fails.For
example...
Dim fMyNonNullableS ingle as Single
fMyNonNullableS ingle = fMyNullableSing le
causes an Exception.
How do I correct this?
Comment