Skip to content

ObjectDataSource DateTime, and Locale

Thinking of using an ObjectDataSource and DetailsView to populate/save your business object? If the object has a DateTime property – lets hope you live in the United States!

Had an strange problem today with a birthday set to October 9, 1940. The edit screen would populate a TextBox with “9/10/1940”, correct for my culture en-AU. Clicking save populates the database with “September 10, 1940”. Strange the edit screen would observe the my culture settings, yet populating the business object doesn’t.

Googling around turned up this: ObjectDataSource ignores culture information when updating. Do’h!

Post a Comment

Your email is never published nor shared. Required fields are marked *