I've been using this piece of code I wrote, and it's functioning in the murkiest way possible. I want to add a row to the database that has two DateTime columns:
myrow.ApprovalDate = DateTime.Now
myrow.ProposedDate = DateTime.Now
When I update the database I receive this error:
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
I've even tried hard coding a value that was copied from the database into the object that was being updated:
// I copied this value from the DB
myrow.ApprovalDate = Convert.ToDateTime("2008-12-24 00:00:00.000");
The weird thing is that the above approach worked for the initial insert to the database but failed moving forward. Still getting the same problem. Any ideas as to what's happening?