I am using a MySQL .NET Connector and when I insert a record into a database, it takes the .NET DateTime and complains that it can't convert from .NET DateTime to MySQL DateTime. Is there a way I can have the entity framework not update this field?
Do I just remove it from the entity model or is there a property I can set on it?
I have tried Convert Zero Datetime=True
& Allow Zero Datetime=True
in the connection string, but this just inserts 0000-00-00 00:00:00:00
when I do an insert.
I have tried explicitly setting the Datetime
via Convert.ToDateTime(updateDT.ToString("yyyy-MM-dd hh:mm:ss"));
, but this does not work and I don't want to have it to explicitly set the datetime for every object that has a DateTime
field. I want the database to take care of setting the date for me on inserts or updates.