To add to Suha's answer, you cannot know if a DateTime field has been assigned DateTime.MinValue or simply holds the default value. Programmatically you can assume the field is not assigned. Usually DateTime.MinValue is not a valid date to
enter in a user interface, in which case you can assume if the value is MinValue the user has not yet assigned a value. MinValue is often used to indicate unassigned dates. However, a nullable DateTime might be a better option.---
Happy Coding!
Morten Wennevik [C# MVP]
Marked as answer byBin-ze ZhaoThursday, September 2, 2010 7:39 AM
To add to Suha's answer, you cannot know if a DateTime field has been assigned DateTime.MinValue or simply holds the default value. Programmatically you can assume the field is not assigned. Usually DateTime.MinValue is not a valid date to
enter in a user interface, in which case you can assume if the value is MinValue the user has not yet assigned a value. MinValue is often used to indicate unassigned dates. However, a nullable DateTime might be a better option.---
Happy Coding!
Morten Wennevik [C# MVP]
Marked as answer byBin-ze ZhaoThursday, September 2, 2010 7:39 AM