SQLiteDateTime.ToString() fails

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
klosels
Posts: 10
Joined: Wed 31 Oct 2018 16:33

SQLiteDateTime.ToString() fails

Post by klosels » Thu 21 Nov 2019 13:20

We are using dotConnect for SQLite 5.12.1422 and EF6.2.
One property in our model is of type DateTimeOffset, in the database the values are correctly stored in a culture-agnostic way using ISO formatting.
We also implement IDbCommandInterceptor to log database activity. There however, logging of a DbParameter.Value.ToString() fails for the SQLiteDateTime with the attached exception if CurrentUICulture is switched to a different value than the default for the system.

Exception:

Code: Select all

System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.Substring(Int32 startIndex, Int32 length)
at Devart.Data.SQLite.SQLiteDateTime.ToString(String format)
at Vector.ReportViewer.Data.DatabaseAccess.DatabaseLogger.OnEnd[T](DbCommand command, DbCommandInterceptionContext`1 interceptionContext)

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: SQLiteDateTime.ToString() fails

Post by Shalex » Fri 22 Nov 2019 16:01

Could you please send us a test project with the database file (or DDL/DML script instead) so that we can reproduce the error in our environment?

Post Reply