View Ticket
Not logged in
Ticket UUID: 5b0c43fec967c5f19a5b79da8f997432bd6a617a
Title: An problem about System.Data.SQLite.SQLiteDataAdapter.Fill
Status: Closed Type: Incident
Severity: Important Priority: Medium
Subsystem: Convert Resolution: Works_As_Designed
Last Modified: 2018-04-04 04:44:13
Version Found In:
User Comments:
anonymous added on 2018-04-03 03:03:35:
Question on stackoverflow
Maybe should need some elegant solutions - this error is not common, but it may cause great trouble
1. Add some overloads for Fill method, add a argument to set ignore or not the convert error / ignore error data row
2. Add some convert controler, can let user set the custome convert way
3. …

anonymous added on 2018-04-04 03:17:48:
You mark this issue as WAD. So, can you provide a feasible solution, please?

mistachkin added on 2018-04-04 04:40:41:
There are several possible solutions.  One is to change the type of the column
so that the System.Data.SQLite type conversion subsystem does not try to see it
as a DateTime.

Another is to disable all type conversions for the associated connection using
the "GetAllAsText" connection flag, e.g.:

          using (SQLiteConnection connection = new SQLiteConnection(
              "Data Source=test.db;Flags=GetAllAsText"))

            // ...

Alternatively, you could use the "UseConnectionReadValueCallbacks" connection
flag and implement a custom SQLiteReadValueCallback to change the value into
something that is a DateTime.

Finally, you could modify the type mappings for the connection to map the
"TIMESTAMP" type to a string instead of a DateTime.  See "AddTypeMapping" in
the help file.

mistachkin added on 2018-04-04 04:44:13:
Example of a read value callback: