简体   繁体   English

在 EntityDataSource CommandText 中使用 ISNULL 函数

[英]Using ISNULL function in EntityDataSource CommandText

I wrote below query in EntityDataSource CommandText .我在EntityDataSource CommandText写了以下查询。

SELECT FIRST_NAME + ' ' + ISNULL(LAST_NAME, '') AS Customer
FROM CUSTOMER

but there is an error as isnull cannot be resolved into valid type or function .但有一个错误,因为isnull cannot be resolved into valid type or function

how cold i solve this ?我解决这个问题有多冷? what should i use instead of ISNULL ?我应该用什么来代替ISNULL

There is no support for ISNULL in entity sql.实体 sql 中不支持ISNULL You'll have to resort to CASE WHEN :你必须求助于CASE WHEN

CASE
    WHEN LAST_NAME IS NULL THEN '' 
    ELSE LAST_NAME 
END

Can't help it.没办法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM