Created
May 9, 2012 23:13
-
-
Save Boztown/2649625 to your computer and use it in GitHub Desktop.
C#: SqlDataReader NullCheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TourHostCompanyProv.Text = NullCheck(reader, "fldTourHostCompanyProv"); | |
public string NullCheck(SqlDataReader reader, string key) | |
{ | |
return (reader[key] == DBNull.Value) ? String.Empty : (string)reader[key]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment