View Single Post
  #2 (permalink)  
Old April 30th, 2007, 02:04 AM
mike_remember mike_remember is offline
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Depends how you are filling your datalist, one way could be checking for null from database itself using the ISNULL function, another way could be checking for null while binding, something like below:

<asp:Label Runat="server" ID="lblTest" text='<%#DataBinder.Eval(Container.DataItem,"no")= = DBNull.Value.ToString() ? "Date not filled" : DataBinder.Eval(Container.DataItem,"no")%>'>

There could be lot other ways too....

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.