Skip to content

Instantly share code, notes, and snippets.

@eithe
Created May 16, 2013 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eithe/5589891 to your computer and use it in GitHub Desktop.
Save eithe/5589891 to your computer and use it in GitHub Desktop.
SQL-like IsNull (VB.net)
Public Class Util
Public Shared Function IsNull(Of T)(ByVal Value As T, ByVal DefaultValue As T) As T
If Value Is Nothing OrElse IsDBNull(Value) Then
Return DefaultValue
Else
Return Value
End If
End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment