在 Visual Studio 的 .xsd 设计器中设计数据表时,有一个属性指定当表遇到空值时要做什么:
问题是,如果DataType
是System.DateTime
,我无法返回empty
或nothing
。它总是抛出异常。
在我工作时,我可以执行以下操作:
If(row.IsDateLastRecallPrintedNull, DateTime.MinValue, row.DateLastRecallPrinted)
但如果值为DbNull.Value
,我宁愿让它返回。