Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

ss4000 recovery array, intel ss4000 xfs, Proxy.in.audi.vwg, intel ss4000 data recovery, mysql andreas pankratz, maximum execution time exceeded php meldung abfangen, how to convert .cap file to .txt, WWWXXXAPC, WWWXXXAPC site:board.issociate.de, change font size ncurses

Links

XODOX
Impressum

#1: convert 01/01/0001 to empty string

Posted on 2005-10-19 10:15:02 by Tan

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

Report this message

#2: Re: convert 01/01/0001 to empty string

Posted on 2005-10-19 11:26:41 by Islamegy

DateTime type Don't Allow null or empty string.. the only way i found to
workaround this is to convert it to string and check if it's 01/01/0001..
I did myDatetime Class to do this for me when i use ToString() ,
ToShortDateString(),etc...

"Tan @hotmail.com>" <tannguyen88<nospam> wrote in message
news:unD%230TI1FHA.1264@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
>

Report this message

#3: Re: convert 01/01/0001 to empty string

Posted on 2005-10-19 12:07:18 by Sebastian Wojciechowski

create class, inherit from DateTime and overload ToString() method


"Tan @hotmail.com>" <tannguyen88<nospam> wrote in message
news:unD%230TI1FHA.1264@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
>

Report this message

#4: Re: convert 01/01/0001 to empty string

Posted on 2005-10-19 12:22:20 by nomailreplies

Maybe 01/01/0001 is a default value assigned in the table ?

Check the table's design and see if it is a default value.
If it is a default value, change the default value to null or empty.



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/
======================================
"Tan @hotmail.com>" <tannguyen88<nospam> wrote in message
news:unD%230TI1FHA.1264@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

Report this message

#5: Re: convert 01/01/0001 to empty string

Posted on 2005-10-19 12:55:11 by Tan

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:OvqHzSJ1FHA.3524@tk2msftngp13.phx.gbl...
>
> create class, inherit from DateTime and overload ToString() method
>
>
> "Tan @hotmail.com>" <tannguyen88<nospam> wrote in message
> news:unD%230TI1FHA.1264@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
>>
>
>

Report this message

#6: Re: convert 01/01/0001 to empty string

Posted on 2005-10-20 03:39:21 by Otis Mukinfus

Post removed (X-No-Archive: yes)

Report this message

#7: Re: convert 01/01/0001 to empty string

Posted on 2005-10-20 05:14:52 by nomailreplies

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" <OtisMukinfus@newsgroup.nospam> wrote in message
news:l7tdl1pg3hvbrkidm17v6n910ie2ii2l7j@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:OvqHzSJ1FHA.3524@tk2msftngp13.phx.gbl...
>>>
>>> create class, inherit from DateTime and overload ToString() method
>>>
>>>
>>> "Tan @hotmail.com>" <tannguyen88<nospam> wrote in message
>>> news:unD%230TI1FHA.1264@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

Report this message