This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!(myDate > DateTime.MinValue && myDate < DateTime.MaxValue )){ | |
// code for invalid sql datetime | |
} |
Para que a validação seja valida para o envio a um banco de dados SQL Server você pode fazer como abaixo:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!(myDate > SqlDateTime.MinValue.Value && myDate < SqlDateTime.MaxValue.Value )){ | |
// code for invalid sql datetime | |
} |