Public Function GetNonNullable(ByVal tcValue As String) As String Dim lcValue As Integer = "" ' If we have a value If Not tcValue Is DBNull.Value Then lcValue = tcValue End If Return lcValue End FunctionChecking for DBNull.Value is NOT the same thing as checking for null! In fact, in C# the above comparison cannot even be made. I think what you actually want to compare is whether it's equal to null (assuming I've gotten the VB syntax correct):
Public Function GetNonNullable(ByVal tcValue As String) As String Dim lcValue As Integer = "" ' If we have a value If Not tcValue = null Then lcValue = tcValue End If Return lcValue End Function