i'm having some problem converting a sessioned value of datetime to the correct format.
When i use DateTime lastlogged = Convert.ToDateTime(Session["LastLogin"]);i get the value {1/1/0001 12:00:00 AM} (got the value while debugging) but the actual value of Session["LastLogin"] is 2011-08-02 16:35:52.987 which is queried out from SQLServer 2008 data field datetime
Session["LastLogin"]==null(you wantfalse) andSession["LastLogin"].ToString()(you want that date)?DataTime.ParseExact(Session["LastLogin"].ToString(), "yyyy-mm-dd hh:mm:ss", CultureInfo.InvariantCulture);