I can't save values into two nullable columns.
This is the entity I'm saving:
nquote_orderheaders header = new nquote_orderheaders()
{
CreatedDate = DateTime.Now,
SendDate = DateTime.Now,
SentByUser = accountInfo.Username,
CreatedByUser = accountInfo.Username,
QuoteOrderNumber = tempQuoteNumber,
IMCustomerNumber = resellerInfo.CustomerNo,
CustomerEmail = accountInfo.Username,
CustomerName = resellerInfo.CustomerName,
UserComment = "",
StatusId = 1,
CustomerId = data.CustomerId,
ExpirationDate = DateTime.Now.AddDays(14)
};
The SendDate and ExpirationDate fields are nullable Datetimes. They end up null in the database.
I'm using MySql with MySqlConnector 6.5.4. Any suggestions greatly appreciated.
MySqlConnector, maybe it's very picky about matching types. You may try to set nullable DateTime values:SendDate = new Nullable<DateTime>(DateTime.Now).