updating encrypted password in asp.net

spiderpg

New Member
i m trying to allow change password for the user...For this i wrote below code\[code\]SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); conn.Open(); string insCmd = "update Reg set Password=(@EncryptByPassPhrase('12',@Password) where UserName='"+Label1.Text+ "')"; SqlCommand insertUser = new SqlCommand(insCmd, conn); string pwd = TextBox2.Text; System.Text.ASCIIEncoding encryptpwd = new System.Text.ASCIIEncoding(); byte[] bpwdArray = encryptpwd.GetBytes(pwd); insertUser.Parameters.AddWithValue("@Password", bpwdArray); insertUser.ExecuteNonQuery(); conn.Close();\[/code\]but it gives error like\[quote\] Must declare the scalar variable "@EncryptByPassPhrase".\[/quote\]
 
Back
Top