I have an Accounts
table with columns name, password
and 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 email as reader.getString(2)
since it is nvarchar
.
As I read from the internet, if email
is NULL, then it should return eeee
. But it says System.boolean
can not be translated to System.String
.
How can I correct this? Why does it return a boolean value?