Home Unanswered Active Tags New Question

Changing culture from en-US in SQLdemo breaks update

I am trying the latest build 1547 demo, to see if our company shoud buy. I changed the globalization culture to da-DK, and as expected every controls changed to danish, but unfortunately this breaks some of the sql-updated.

In the modalpopupwindow I can no longer update an event. I get an Arithmetic overflow error converting expression to data type datetime. Proberly something to do with converting from the danish dateformat dd/mm/yyyy.

Any help to correct the error would be appriciated.

Asked by Elsborg 3 years ago.
Replies

After adding a manual DateTime conversion in EventDetail.ItemUpdating event handler it works fine:

Default.aspx

<asp:DetailsView ID="EventDetail" runat="server" ... OnItemUpdating="EventDetail_ItemUpdating">

Default.aspx.cs

protected void EventDetail_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
  e.NewValues["eventstart"] = Convert.ToDateTime(e.NewValues["eventstart"], new CultureInfo("da-DK"));
  e.NewValues["eventend"] = Convert.ToDateTime(e.NewValues["eventend"], new CultureInfo("da-DK"));
}
Comment posted by Dan Letecky 3 years ago.

That did the trick, thanks...

Comment posted by Elsborg 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java