protected void Submit1_ServerClick(object sender, EventArgs e)
{
conn.SelectCommand = "select * from admin where username='" + TextBox2.Text.Trim() + "' and password='" + TextBox3.Text.Trim() + "' ";
SqlDataReader dd = (SqlDataReader)conn.Select(DataSourceSelectArguments.Empty);
if (dd.HasRows)
{
Response.Redirect("query_01.aspx");
}
else
{
conn.UpdateCommand = "update admin set [username]='" + TextBox2.Text + "', [password]='" + TextBox3.Text + "' WHERE [id] = '" + TextBox3.Text+"'";
conn.addupdatp("id", TextBox1.Text);
conn.addupdatp("username", TextBox2.Text);
conn.addupdatp("password", TextBox3.Text);
conn.Update();
Response.Redirect("query_01.aspx");
}
dd.Close();
{
conn.SelectCommand = "select * from admin where username='" + TextBox2.Text.Trim() + "' and password='" + TextBox3.Text.Trim() + "' ";
SqlDataReader dd = (SqlDataReader)conn.Select(DataSourceSelectArguments.Empty);
if (dd.HasRows)
{
Response.Redirect("query_01.aspx");
}
else
{
conn.UpdateCommand = "update admin set [username]='" + TextBox2.Text + "', [password]='" + TextBox3.Text + "' WHERE [id] = '" + TextBox3.Text+"'";
conn.addupdatp("id", TextBox1.Text);
conn.addupdatp("username", TextBox2.Text);
conn.addupdatp("password", TextBox3.Text);
conn.Update();
Response.Redirect("query_01.aspx");
}
dd.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货