📄 infosingle.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.Sql;
public partial class InfoSingle : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string id = Session["uid"].ToString();
string strconn = ConfigurationManager.AppSettings["dsn"];
//连接本地计算机的LMS数据库
SqlConnection cn1 = new SqlConnection(strconn);
cn1.Open();
//构造SQL语句,该语句在Users表中检查用户名和密码是否正确
string mysql1 = "select * from dzxx where yonghuID='" + id + "'";
//创建Command对象
SqlCommand cm1 = new SqlCommand(mysql1, cn1);
//执行ExecuteReader ()方法
SqlDataReader dr1 = cm1.ExecuteReader();
if (dr1.Read())
{
this.Label3.Text = dr1["yonghuname"].ToString();
this.Label5.Text = dr1["duzhesex"].ToString();
this.Label7.Text = dr1["banzhengdate"].ToString();
this.Label9.Text = dr1["zhengjiannumber"].ToString();
this.Label11.Text = dr1["tel"].ToString();
this.Label13.Text = dr1["Email"].ToString();
}
//关闭连接
cn1.Close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -