How can I improve this code? What has made this long winded is the fact that I can't use string.IsNullOrEmpty on a data row and instead I have to use a dr.IsHOUSENUMBERNull method AND the string.IsNullOrEmpty to check if it is empty. Why is this? The column in the database is sometimes empty and sometimes NULL.
I'm sure this can be written better:
If Not dr.IsHOUSENUMBERNull Then
If Not String.IsNullOrEmpty(dr.HOUSENUMBER) Then
sbAddress.AppendLine(dr.HOUSENUMBER + " " + dr.ADDRESS1)
Else
sbAddress.AppendLine(dr.ADDRESS1)
End If
Else
sbAddress.AppendLine(dr.ADDRESS1)
End If