Welcome! Log In

Advanced

String was not recognized as a valid DateTime

Posted by Paavo PP Pesusieni 
String was not recognized as a valid DateTime
April 17, 2016 09:05PM
17.4.2016 13.51.08
App version: 1.0.4.0
Error Message: Get Finished Runs

System.InvalidCastException: Specified cast is not valid.
at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
at System.Data.SQLite.SQLiteDataReader.GetString(Int32 i)
at ( )

17.4.2016 13.56.26
App version: 1.0.4.0
Error Message: 500

System.ArgumentOutOfRangeException: Value of '1.1.0001 0.00.00' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
Parameter name: Value
at System.Windows.Forms.DateTimePicker.set_Value(DateTime value)
at  ..ctor()

17.4.2016 13.56.29
App version: 1.0.4.0
Error Message: Setup Claims from DB

System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
at System.Data.SQLite.SQLiteConvert.ToDateTime(String dateText)
at System.Data.SQLite.SQLite3.GetDateTime(SQLiteStatement stmt, Int32 index)
at System.Data.SQLite.SQLiteDataReader.GetDateTime(Int32 i)
at ( )

17.4.2016 13.57.23
App version: 1.0.4.0
Error Message: Sync claims to server outer

System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
at System.Data.SQLite.SQLiteConvert.ToDateTime(String dateText)
at System.Data.SQLite.SQLite3.GetDateTime(SQLiteStatement stmt, Int32 index)
at System.Data.SQLite.SQLiteDataReader.GetDateTime(Int32 i)
at ( )

These are the errors I'm getting and I'm unable to save any claims. I never had this problem a while back when I was using the program on windows 7 but this is what I get with windows 10... Any solution to this?
Ido
Re: String was not recognized as a valid DateTime
April 17, 2016 09:32PM
try setting your date format in windows settings to US style or dd/mm/yyyy

Re: String was not recognized as a valid DateTime
April 17, 2016 10:06PM
This was actually the first thing I tried and gave it another shot after your reply and played with all the options with no luck. I'm still getting the same errors no matter how the region settings are





Edited 1 time(s). Last edit at 04/17/2016 10:09PM by Paavo PP Pesusieni.
Re: String was not recognized as a valid DateTime
April 18, 2016 08:59AM
Ido, take a look at this: http://www.heikniemi.net/hardcoded/2015/08/windows-10-breaks-net-date-parsing-in-certain-locales/

I'm from Finland and I guess this might be the problem I'm having. It seems like I can't fix it from my end as I have tried using all possible date formats so I'm hoping you could roll an update to fix this.
Ido
Re: String was not recognized as a valid DateTime
April 18, 2016 05:17PM
did you try applying this fix: KB3093266 ? its mentioned in the blog post at the start?

Re: String was not recognized as a valid DateTime
April 18, 2016 06:56PM
Yes, I have all the updates up to date and even tried reinstalling them with no luck. I really don't feel like going back to windows 7 just to get this to work sad smiley
Re: String was not recognized as a valid DateTime
April 18, 2016 07:37PM
Alright, I finally found a solution! https://blogs.msdn.microsoft.com/shawnste/2015/08/27/locale-builder-and-finnish-or-other-locales/

After that I also had to remove and redownload LBML and it worked smiling smiley
Ido
Re: String was not recognized as a valid DateTime
April 18, 2016 10:05PM
Amazing! Thank you for sharing : )

When i have a chance i will go through the code and make sure all dates are cast explicitly in the US locale so this wont happen again

Cheers
Ido