Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
I noticed that date is saved as a raw string
(dd/mm/yyyy for UK format) instead of the SQLite yyyy-
Can anything be done to have it saved in SQLite format
as is done in SQLiteODBC engine supplied by Christian.
Logged In: NO
Lets' assume to use SQLite 3.
I looked inside the code and I noticed that there is no
handling of the DbType.DateTime inside the sqlite_vm.bind
function. The same happens with the DbTye.Decimal and with
the DbType.Binary. When no special handling is done, all
parameter values are converted to strings by the ToString()
functions. In this way the date have the format defined in
the control panel (this means ALWAYS different), the BLOBs
are saved with the string "System.Byte" and the decimal
may use a comma as decimal separator (again control panel)
with the clear problems behind.
The first step to the solution (put the data in the right format
in the database) is to enhance this procedure in order to
handle better the different types. This is easy for Decimal
and DateTime, not so easy for the binary format (I haven't
looked yet at the mashalling of string barameters)
I looked at the code and I propose this modification to solve
the problem DateTime and Decimal encoding.
The modified function is sqlite_vm.bind
DateTime dateVal = Convert.ToDateTime(aVal);
if (dateVal == dateVal.Date)
aVal = dateVal.ToString("yyyy-MM-dd");
aVal = dateVal.ToString("yyyy-MM-dd
Logged In: YES
I changed the internal representation of DateTime from
string to Int64. Now it stores the precise number of ticks
inside DateTime value.