Isn't it simpler to assume that "01/01/0001" is a default value in the
table in question, and that changing that default value to <null>
would simplify the checking/text assignment task ?
Then, checking for IsDBNull / System.DbNull is simple, or use the faster :
bool isNull = (dr[ordinal]==System.DBNull.Value);
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ :
http://asp.net.do/faq/
Foros de ASP.NET en Español :
http://asp.net.do/foros/
======================================
"Otis Mukinfus" <Ot**********@newsgroup.nospam> wrote in message
news:l7********************************@4ax.com...
On Wed, 19 Oct 2005 11:55:11 +0100, "Tan" <tannguyen88<nospam>@hotmail.com>
wrote:
If you are using .NET 2.0 you can use System.Nullable<T>
Look up System.Nullable in the help file.
I can not inherit from DateTime, in .net 2.0 is a sealed class, any
suggestions?
Tan
"Sebastian Wojciechowski" <sebastian_usenet :this funny sign: icsharp.net>
wrote in message news:Ov**************@tk2msftngp13.phx.gbl...
create class, inherit from DateTime and overload ToString() method
"Tan @hotmail.com>" <tannguyen88<nospam> wrote in message
news:un****************@tk2msftngp13.phx.gbl...
I am using ObjectDataSource bind to DetailView which will contain one of
the column with the value type is date. whenver the value of this column
is empty . then it will be display the date in the format ( 01/01/0001),
How can I convert it to empty string or just string?
Thank you very much
tan