For ExecuteNonQuery to return 1 there should be a record WHERE id = '6' . Now, if you want to update the line, if the value is different, change the query:
UPDATE messages SET Unread = 'N' WHERE id = '6' AND Unread <> 'N'
If you ran this query and the Unread value Unread already 'N' , then it will return the string 0 .
source share