Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 String was not recognized as a valid DateTime

Author  Topic 

shemayb
Posting Yak Master

159 Posts

Posted - 2008-05-15 : 17:59:49

hi!
I have this error String was not recognized as a valid DateTime.
It appears when the value of my date is null.How can this be handled?
thank you so much!

This is my code:

DateTime sDte = Convert.ToDateTime(dtEpi.Rows[0]["s_date"].ToString());



lblsDate.Text = sDte.ToShortDateString();


Funnyfrog
   

- Advertisement -