protected void Button6_Click(object sender, EventArgs e)
{
Random rnd = new Random();
string resetpassword = rnd.Next(5000, 100000).ToString();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["HealthDBContext"].ConnectionString);
conn.Open();
string reset = "UPDATE Users SET" + " [email protected]" + " WHERE [email protected]";
SqlCommand com = new SqlCommand(reset, conn);
com.Parameters.AddWithValue("@pass", resetpassword);
com.Parameters.AddWithValue("@user", TextBox1.Text);
conn.Close();
}
何らかの理由でパスワードが更新されません。更新ステートメントが機能しない
を実行Oooohの、あなたが実際のアプリケーションにプレーンテキストでパスワードを保存していない私に教えてください。 –
このメソッドを 'ExecuteNonQuery();'、あなたが '挿入'、 '削除'、 '更新中'である場合に限り使用します。など –