2
I have an object that has a property Datetime and, start with the value of the property Datetime.Minvalue
The problem is that, when passing this value to register in the SQL Server database gives an error:
Sqldatetime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
I understand that the error is because the Minvalue property returns a value less than the minimum accepted by SQL Server, but has how to make the Minvalue value compatible with the database in use (in this case SQL Server)?
or there is a better way to insert an empty date into the bank?
I don’t know what your code looks like, but you’ve tried something like: cmd. Parameters["@data"]. Value = d == Datetime.Minvalue ? null : d.Tostring();
– Rovann Linhalis
Washington, in this case you better save one
null
really, don’t you think?– Jéf Bueno