我可以通过单击按钮将会话值存储在表中吗?在我下面的代码中,我想要UserName
in 表..
这是我正在使用的代码:
string cmdstr = "select count(*) from Reg where UserName='" + TextBoxaun.Text + "'";
SqlCommand checkUser = new SqlCommand(cmdstr, con);
int temp = Convert.ToInt32(checkUser.ExecuteScalar().ToString());
if (temp == 1)
{
string cmdstr2 = "select Password from Reg where UserName='" + TextBoxaun.Text + "'";
SqlCommand pass = new SqlCommand(cmdstr2, con);
string password = pass.ExecuteScalar().ToString();
con.Close();
if (password == TextBoxapass.Text)
Session["newapply"] = TextBoxaun.Text;
}