我有一个linq查询,其中我想包括那些非空或空的数据库字段的记录,但是当我使用string.isNullorEmpty它给了我错误。我怎样才能实现这个任务,我的查询是linq查询中使用string.IsnullorEmpty的问题
from post in PostIdPostMeta1
join pstmt in postrepository.GetAllPostMetas() on post.int_PostId equals pstmt.int_PostId
where string.IsNullOrEmpty(pstmt.vcr_MetaValue) == false
select post
如果我改变string.IsNullOrEmpty(pstmt.vcr_MetaValue)==假到pstmt.vcr_MetaValue!=的String.Empty它给我SQL Server会不处理NTEXT的比较,文本,XML或图像数据类型错误
什么是错误? – Aliostad 2011-05-04 10:02:25
布尔IsNullOrEmpty(System.String)'没有支持转换为SQL – 2011-05-04 10:03:54