//Code below string mysalt = BCrypt.GenerateSalt(12); string myharsh = BCrypt.HashPassword(txtpassword.Text, mysalt); //Now i want to confirm if the record exist on my database var check = (from c in k.passwordtable select c).FirstOrDefault(); string password = check.passoword; if (BCrypt.CheckPassword(txtpassword.Text, check) == true) { lblconfirm = "Password Exist"; } else { check.password = myharsh; k.savechanges(); lblconfirm = "added"; } //from the code above i have tried using similar password just to confirm, but its not working, //but if i try it without checking the database it works like this if (BCrypt.CheckPassword(txtpassword.Text, myharsh) == true) { lblconfirm = "Password Exist"; } else { lblconfirm = "Password does not Exist"; } // how do i retrieve record from the databse and confirm it before saving it to the database to avoid duplicate. //Thanks, I do appreciate your time and effort
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)