I am trying to build a simple website using an "ASP.NET Dynamic Data Entities Web Application" project template in VS 2012 (C#). It is pretty much the standard template setup, with an entity where DateTime type property is part of a primary key (the underlying table has also the SQL DateTime type on the mapped column). I get FormatException when I try to see the Details page, or edit a row:
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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FormatException: String was not recognized as a valid DateTime.]
System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +965
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
System.Web.UI.WebControls.FormView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +105 System.Web.UI.WebControls.FormView.EnsureDataBound() +178
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75 System.Web.UI.Control.EnsureChildControls() +83 System.Web.UI.Control.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
I tried setting the culture in <globalization>
node in web.config but it did not help.
The URL for Details page contains the columns in query string, looking like this: &Created=09%2F30%2F2013 16%3A10%3A33&Updated=09%2F30%2F2013 23%3A10%3A40 for a row where Created is '30-09-2013 16:10:33' and Updated '30-09-2013 23:10:40'.
It is my first Dynamic Data project so I do not really know what to do... Thanks in advance for any help.
Edit:
Adding
<globalization uiCulture="en-US" culture="en-US"/>
to system.web node of the main web.config caused the exception to disappear, but now the Details can't find the correct row, saying "No such item."