I have a controller:
[HttpPost]
public ActionResult Create(Auction auction)
{
var db = new EbuyDataContext();
db.Auctions.Add(auction);
db.SaveCh
I had the same problem when I tried to save an unassigened DateTime member to the DB, while using EntityFramework. I read the answers here, and I learned that it can be solved by declaring the member as nullable. I tried it, and it worked! So here is a code snap, for those who need it:
public Nullable MyDateTime { get; set; }
or
public DateTime? MyDateTime { get; set; }
Later I could use it like bellow:
if(MyDateTime.HasValue)
{
DoBlaBla(MyDateTime.Value);
}
or just assign a value to it like nothing had happen...
MyDateTime = DateTime.Now;