I have an SQL field that can contain a decimal value or may contain nulls. Currently, when it contains null and I try to retrieve it, an exception occurs. I would like to be able to handle either situation without an exception occurring if possible. When I encounter a nulll value, I would then like to be able to set the associated textbox on my webpage to blank - instead of zero.
My code to retrieve the field is attached.
Dim decAPYRate As Decimal
decAPYRate = .GetDecimal(21)
Catch ex As Exception
decAPYRate = 0