/ Published in: VB.NET

This code converts database NULL field values to a string. The first argument represents the field from the database (maybe a Datarow field) and the second argument is the optional string that should be returned if a NULL value is encountered. By default, the function returns an empty string value.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Shared Function IsNullToString(ByVal _PossibleNullObject As Object, Optional ByVal _IfNullReturnString As String = "") As String If Not IsDBNull(_PossibleNullObject) Then Return _PossibleNullObject.ToString Else Return _IfNullReturnString End If End Function
Comments
