0
public Nullable<bool> BROUGHT { get; set; } // EDMX generate this code, so I can not change this
BROUHGT (DB) 열을 확인하고 싶습니다.Asp.Net MVC3, Bool 열 null 검사
은 그래서
Error 2 Operator '!=' cannot be applied to operands of type 'bool?' and 'System.DBNull' ...
내가 그 열을 확인 널 (null) 방법
if (table.BROUGHT != DBNull.Value && Convert.ToBoolean(table.BROUGHT)){..}
하지만 오류 메시지가 말과 같은 코드를 작성?
감사합니다.
와우 대단히 감사합니다 .Value는 null 허용 문자열에 대해서도 작동합니까? –
@Expertwannabe, 문자열은 (nullable) 값 유형이 아니므로 * null * * 또는 * 유효한 문자열입니다. 값 속성이 없습니다. –
아하, 알 겠어. 그래서 bool, int, date 및 decimal 형식은 .Value와 같습니다. 고맙습니다! –