Problem 1: You re invoking ExecuteNonQuery()
which is not required as you are invoking select
command.
Remove this :
selectLogin.ExecuteNonQuery();
Problem 2: use ||
for Logical OR
Operation.
Try This :
if (readerLogin.IsDBNull(0) || readerLogin.IsDBNull(2))
continue;
Solution 2: Hashbytes
can not be decrypted
as they are one direction. The only way to Resolve the problem is to hash the user password
value and compare it with the existing password value
in database.