Server Error in '/' Application.

String was not recognized as a valid DateTime.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: String was not recognized as a valid DateTime.

Source Error:


Line 20:             lbTitle.Text = data.TieuDe_Vn;
Line 21:             ltrDetail.Text = data.ChiTiet_Vn;
Line 22:             lbDate.Text = Convert.ToDateTime(data.NgayTao).ToString("dd/MM/yyyy");
Line 23:             lbCount.Text = data.LuotXem.ToString() + " Đã xem";
Line 24:             BaiViet.SuaLuotXem(data.ID.ToString(), (data.LuotXem + 1).ToString());

Source File: d:\Inetpub\vhosts\muoituyen.vn\httpdocs\Vn\DetailArticle.aspx.cs    Line: 22

Stack Trace:


[FormatException: String was not recognized as a valid DateTime.]
   System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +4593730
   System.Convert.ToDateTime(String value) +66
   Vn_DetailArticle.Page_Load(Object sender, EventArgs e) in d:\Inetpub\vhosts\muoituyen.vn\httpdocs\Vn\DetailArticle.aspx.cs:22
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8964; ASP.NET Version:2.0.50727.8962