Home > Database > Mysql Tutorial > body text

ASP.NET后台显示信息、修改密码等操作

WBOY
Release: 2016-06-07 16:12:55
Original
1172 people have browsed it

protected void Page_Load(object sender, EventArgs e){//显示姓名等信息string sql = select * from [stu] where id=+Convert.ToString(Req【本文来自鸿网互联 (http://www.68idc.cn)】uest.QueryString[Id]);DataTable dt = new SqlHelper().ExecuteQuery

protected void Page_Load(object sender, EventArgs e)
{
//显示姓名等信息
string sql = "select * from [stu] where id="+Convert.ToString(Req【本文来自鸿网互联 (http://www.68idc.cn)】uest.QueryString["Id"]);
DataTable dt = new SqlHelper().ExecuteQuery(sql, CommandType.Text);
Label1.Text= Convert.ToString(dt.Rows[0]["stuname"]);

}
protected void Button1_Click(object sender, EventArgs e)
{
//修改密码等
string upsql = "update [stu] set [password]=" + TextBox1.Text.Trim() + "where id=" + Convert.ToString(Request.QueryString["Id"]);
int rows = new SqlHelper().ExecuteNonQuery(upsql, CommandType.Text);
Response.Write("<script language=&#39;javascript&#39;>alert(&#39;密码修改成功!&#39;);top.location=&#39;./stu.aspx&#39;;</script>");
}
Copy after login

 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!