1.There are two property of the current thread that control the current culture:
-
Thread.CurrentThread.CurrentUICulture
- control the UI part
-
Thread.CurrentThread.CurrentCulture
- control the logic part, including the conversion of DateTime to the culture needed by the SQL server.
2.In your code, before to convert the data (DateTime, but also numerical values) that come from the UI you should convert it to DateTime value you should use the 2nd current culture property, supposing that you are set it to be the culture info needed by your logic (and your SQL server), like in the example bellow:
DateTime myDate;
DateTime.TryParse(dateStringFromUI, System.Threading.Thread.CurrentThread.CurrentCulture, DateTimeStyles.AllowWhiteSpaces, out myDate)