Question

I want to initialize a DateTime entity to the minimum possible date in TSQL.
(as you all know its 1/1/1753)

Is there a standard way to represent this date in ASP.NET ?
I mean doing something like DateTime.SQLMinValue (this doesn't exist), instead of doing
new DateTime(year, month, date) ?

If so, please post it, Thanks!

Was it helpful?

Solution

System.Data.SqlTypes.SqlDateTime.MinValue;

...and the MSDN documentation for reference.

OTHER TIPS

EDIT: Luke is right, extension methods are not an appropriate solution to this problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top