Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi, I'm implementing a Homepage for a Website, using MVC 5 and SQL and I'm having a issue with the password changing part.

I'm hashing the password and using "salt" on it. But when I try to change it through SQL, it ignores my

SQL
update users
set Password = @sPassword


Am I doing something wrong in regards to the idea overall? It should be a simple process. And I have the email changing going correctly. But not the password probably due to this hashing thing, can someone share some thoughts?

Thanks.
Posted
Updated 13-Oct-14 8:29am
v3
Comments
[no name] 13-Oct-14 13:52pm    
1.) What error Message? Duplicate blabla ....for field Password ?
2.) You really like to assign same Password for all users, or you simply not Show the WHERE clause in the SQL snippet?
VC.J 13-Oct-14 13:57pm    
the query must be something like update Users set Password =@password where UserID=@userID
Zamuk 13-Oct-14 14:11pm    
Yes I have that
Zamuk 13-Oct-14 14:11pm    
Ok I found my main issue.
I have a password for a user1 in my database. (with a certain hash)

When I attempt to do a password change and I retype the former password, in order to validate that I am the user1, the program is ready a completely different hash. Resulting in a return -1 in SQL. is this supposed to happen?
VC.J 13-Oct-14 14:13pm    
great :) are you using execute scalar

1 solution

I am not able to replicate your issue at my end
you can see those link for hashing may be that can help you
Salted Password Hashing

and
MSDN LINK
 
Share this answer
 
v2
Comments
aarif moh shaikh 14-Oct-14 2:44am    
exactly from my side....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900