Entity Framework - SQL Server 2005 - IIS Server datetime issue

核能气质少年 提交于 2019-12-05 17:55:30

My issue is resolved now. Issue was with the culture settings in IIS. I've added these line to my applications web.config and it is working fine now.

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB"/>

For more information check out this Issue with culture settings in IIS

IT depends on the culture of the server, you can format your culture with invariant format, on your date 13-08-2012, it consider 13 as month.

//Here an example of formatting with invariant culture
CultureInfo yourCulture = CultureInfo.InvariantCulture;
yourValue.ToString("yourFormat",yourCulture));

Verify that the date time formatting. Also, DateTime doesn't have the same range as SqlDateTime. You'll run into trouble if you receive an empty value.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!