in the database i have certain date as 01/01/1900.now while displaying this in the data grid along with the other columns i would like to display all the dates having value 01/01/1900 as blank.is it possible to do so?if yes then how?
s1986 0 Light Poster
Recommended Answers
Jump to PostYou can easily create a function and call it, like below:
<script language="vb" runat="server"> Function ChkDate(ByVal dt As String) As String If dt = "01/01/1900" Then ChkDate = "" Else ChkDate = dt End If End Function </script> <%# ChkDate(Eval("Date")) %>
Jump to PostUsing RowDataBound event helps seperating the markup from the code. In performans terms, they seem equal
Jump to PostI agree, using RowDataBound event will be better. But if it is too advanced, stick with a function. You can always do the function first to fix errors, then move onto RowDataBound.
It's all relatively easy, just look it up and you'll find it.
All 10 Replies
serkan sendur 821 Postaholic Banned Featured Poster
SheSaidImaPregy 28 Veteran Poster
serkan sendur 821 Postaholic Banned Featured Poster
Sulley's Boo commented: =') +5
SheSaidImaPregy 28 Veteran Poster
s1986 0 Light Poster
serkan sendur 821 Postaholic Banned Featured Poster
SheSaidImaPregy 28 Veteran Poster
s1986 0 Light Poster
SheSaidImaPregy 28 Veteran Poster
s1986 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.