📄 st_query.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
namespace STGROUP
{
/// <summary>
/// ST_query 的摘要说明。
/// </summary>
public class ST_query : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Repeater st_rp_information;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string st_connstr= ConfigurationSettings.AppSettings["st_dbconn"];
SqlConnection st_conn=new SqlConnection(st_connstr);
string st_sqlstr="select * from ST_student where ST_Student_id=@id";
SqlCommand st_comm=new SqlCommand(st_sqlstr,st_conn);
st_comm.Parameters.Add(new SqlParameter("@id",SqlDbType.VarChar,50));
st_comm.Parameters["@id"].Value=Session["user_id"].ToString();
st_conn.Open();
SqlDataReader st_dr=st_comm.ExecuteReader();
st_rp_information.DataSource=st_dr;
st_rp_information.DataBind();
st_conn.Close();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.st_rp_information.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.st_rp_information_ItemCommand);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void st_rp_information_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -