Click here to Skip to main content
15,906,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a date field in my application in which tool used to display it is LABEL.
I have given below code to display the date.
C#
lblInvestDate.Text = implementCorrectiveAction.InvestigationDate.ToString();

But using this when date field value is null in DB, it does not shows blank.
I need to display blank label for date field, when DB value is null.
Please help me to solve this.
Posted

1 solution

Check for the DBNull[^] class.
 
Share this answer
 
Comments
CSR89 26-Nov-12 4:49am    
Sorry I cant Understand..
Richard MacCutchan 26-Nov-12 5:02am    
Check to see whether the item is equal to DBNull.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900