ASP.NET修改密码时能运行过去,但是数据库里数据没有修改掉
{ stringsql="updateusersse...
{ string sql = "update users set userpwd=@pwd where username=@name"; SqlConnection conn = new SqlConnection("server=.;database=jing;user id=sa;pwd=123"); conn.Open(); SqlCommand comm = new SqlCommand(sql, conn); comm.Parameters.Add(new SqlParameter("@pwd", SqlDbType.NVarChar, 50)); comm.Parameters["@pwd"].Value = TxtUPdataPwd.Text.Trim(); comm.Parameters.Add(new SqlParameter("@name", SqlDbType.NVarChar, 50)); comm.Parameters["@name"].Value = "'"+Request.Cookies["uName"].Value+"'"; comm.ExecuteNonQuery(); conn.Close(); Page.RegisterStartupScript("aaa", "<script>alert('修改成功');</script>"); }
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询