search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Changing culture from en-US in SQLdemo breaks update

Asked by Elsborg
12 years ago.

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.

Comment posted by Dan Letecky
12 years ago.

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


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


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 Elsborg
12 years ago.

That did the trick, thanks...

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.