を送信してください...私はパスワードを忘れてしまいました。method.accessデータベースを忘れてしまい、電子メールを送信しようとしています。もし私が多くの経験を持っていないので、あなたが私を助けてくれたら。よろしくお願いします。ログインはユニークです。 C#sql asp.netあなたが私を助けてくれると助けてくれるなら、C#
protected void LinkButton1_Click(object sender, EventArgs e)
{
var sqlCon = new SqlConnection(System.Configuration.ConfigurationManager.
ConnectionStrings["ConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = sqlCon;
cmd.CommandText = "select Password from Person where Login= @Login ";
cmd.Connection.Open();
string Password = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
cmd.Dispose();
SqlCommand cmd1 = new SqlCommand();
cmd1.Connection = sqlCon;
cmd1.CommandText = "select e_mail from Person where Login= @Login ";
cmd1.Connection.Open();
string e_mail = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
cmd.Dispose();
if (Login.Text.Equals("@Login"))
{
Class1 S = new Class1();
S.sendMail(e_mail, "Your Password request", Password);
Response.Write("<script>");
}
}
スカラー変数 "@Login"を宣言しなければならないというエラーを出力しています – emilios
これを今試してみましたが、私はパラメータメーターを追加しました.. –