Question

I wrote below query in 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.

how cold i solve this ? what should i use instead of ISNULL ?

Was it helpful?

Solution

There is no support for ISNULL in entity sql. You'll have to resort to CASE WHEN:

CASE
    WHEN LAST_NAME IS NULL THEN '' 
    ELSE LAST_NAME 
END

Can't help it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top