convert date 01/01/0001 to empty string

T

Tan

Hello

I have a property date in the object data sourse which bind to Detailview,
when this date property is null , it will display the date 01/01/0001, how
can I convert it to empty string or make it blank ?

Thank you much very in advance

Tan
 
G

Guest

If (MyDate==DateTime.MinValue)
txtDate.Text = String.Empty;
else
txtDate.Text = MyDate.ToString();

or similar.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top