Mappping of DateTime in poco to Time in mysql database not working after 4.0.40 update

Hi,

I have a POCO(myPoco) with a datetime field and a table in a mysql database with a time field. The mapping between myPoco and the database table worked fine until I upgraded from 4.0.39 (I think), to 4.0.40. Now I get a System.FormatException when I do a db.Select< myPoco>().

I read something about poor support of the database TIME field in ormlite. Should I stop using time in the database and change that to bigint. And then change myPoco dateTime field to timespan? As I understand ormlite will then store my timespan as ticks in the database.

Henrik

There was no official v4.0.39 release unless you upgraded from MyGet (last version with odd number was v4.0.35).

But it should be changed to use what db.CreateTable<T> uses when it creates your table which for TimeSpan is BIGINT, i.e:

CREATE TABLE `Poco` 
(
  `TimeSpan` BIGINT NOT NULL 
);

Which you can get from:

db.CreateTable<Poco>();
db.GetLastSql().Print();

Ok thanks. Yes I upgraded from MyGet to get the 4.0.39.
I had to ask since I think it will take some work to make this change to my code. Was looking for an easy way out :slight_smile: