Monday, January 26, 2015

ASP.NET GridView Update Row Date Bug?

Hi everyone,


I think I've found a bug?


I've got a GridView control populated by an SqlDataSource. The datasource pulls through 2 dates. The dates are in SQL Server, in the 'date' format and in a universal sub format like this; '2015-01-26'.


In my GridView, I've formatted those dates like this {0:dd/MM/yyyy}. It reads fine. So far so good.


When I come to edit, it updates with no errors. HOWEVER, it's actually doing something really weird!


It's mixing the month and day around?!? So if I type in 12/01/2015 and update, it's sending 01/12/2015 to my database! My client will not be very happy with me if I allow this behaviour!


The thing is though, there is no mention of this other format anywhere so I have no idea where it has come from. I have entered dd/MM/yyyy so how is it possible that it's mixing dd and MM around?


Antony




:D


No comments:

Post a Comment