added DateTime to Order table, get ObjectContext inconsistent error upon checkout?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
Using 2.10.

I added a null DateTime to the order table.

I added

public DateTime myDate { get; set; }

to both Orders.cs and OrderModel.cs.

In OrderProcessingService.cs, I set the date to a non-null value when creating a new order, and I can see that it gets saved in the Order table.

However, I'm getting this error msg on the checkout/confirm page:

The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: The 'myDate' property on 'Order' could not be set to a 'null' value. You must set this property to a non-null value of type 'DateTime'.

How can I resolve this?

Thanks!!!
12 年 前
nopNeophyte wrote:
I added a null DateTime to the order table.

I added

public DateTime myDate { get; set; }

It's not nullable. Use "public DateTime? myDate { get; set; }" (question mark)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.