public Nullable<bool> BROUGHT { get; set; } // EDMX generate this code, so I can not change this
我想对 BROUHGT (DB) 列进行空检查。
所以我写代码
if (table.BROUGHT != DBNull.Value && Convert.ToBoolean(table.BROUGHT)){..}
但错误信息说,
Error 2 Operator '!=' cannot be applied to operands of type 'bool?' and 'System.DBNull' ...
我如何对该列进行空检查?
谢谢!