Click here to Skip to main content
15,917,174 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
I have four fields: old password, new password, confirm password and a change password button.

I want C# source code for changing password with respect to the database. Please help me out....

[We don't just provide code.]
Posted
Updated 1-Oct-10 11:32am
v3
Comments
Sandeep Mewara 29-Sep-10 3:03am    
No effort!

first check the old password with database pass word field
if the password match then
if (newpassword.text==confirmpasswd.text)
{
"UPDATE tablename SET PASSWORD='" +newpassword.text +"'' WHERE condition"
}
 
Share this answer
 
Try changing:

C#
cmd.CommandText = " update tbl_Leads set User_Password="txtNewPassword.Text"  where User_Id="Session["sUserId"]"";


to
C#
cmd.CommandText = " update tbl_Leads set User_Password=@User_Password  where User_Id="Session["sUserId"]"";
 
Share this answer
 
v2

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