GridView in ASP.net using the wrong MM / DD / YYYY date format instead of DD / MM / YYYY

I have a GridView in ASP.net that populates from SqlDataSource.

one of the columns in the DB table is Datetime, which is set on 04/30/2009, when I show the grid view in asp, it displays as 04/30/2009 (which is good)

however, when I click edit on the grid line and then hit the update without changing the date, I get an SQL error that says the date format is wrong. This is because he believes that 30 refers to a month, not a day.

I tried to resolve this by setting <% @Page uiCulture = "en-gb" culture = "en-gb"%>

but without effect.

any ideas?

+3
source share
2 answers

GridView, String a DateTime. DataFormatString {0:d}, .

+1

, , SQL Server, .

+1

Source: https://habr.com/ru/post/1717352/


All Articles