Is SQL Server Compact Edition ISNULL (sth, '') returning a boolean?

I have a table Accountswith columns name, passwordand email. They are all type nvarchar. I wrote a query like

SELECT name, password, ISNULL(email, 'eeee') 
FROM Accounts 
WHERE name = '" + textBox1.Text + "' AND password ='" + textBox2.Text + "'"

I read the letter how reader.getString(2), since it is nvarchar.

As I read from the Internet, if emailit is NULL, it should return eeee. But he says that System.booleancannot be translated into System.String.

How can i fix this? Why does it return a boolean?

+5
source share
1 answer

this ISNULL SQL Server CE. .

: CASE WHEN email IS NULL THEN 'eeee' ELSE email END COALESCE. .

. , , .

+15

All Articles