details.aspx.cs
资源名称:MEIMS.rar [点击查看]
上传用户:ah_jiwei
上传日期:2022-07-24
资源大小:54044k
文件大小:2k
源码类别:
数据库编程
开发平台:
Visual C++
- 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;
- public partial class teacher_details : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- string stu_ID = Request.QueryString["stu_Id"].ToString();
- SqlConnection connection = DB.connect_la();
- connection.Open();
- string commandString = "SELECT exam_stu_table.* FROM exam_stu_table,stu_id_num WHERE stu_id_num.exam_id=exam_stu_table.exam_id and stu_id_num.stu_id=" + stu_ID;
- SqlCommand cmd = new SqlCommand(commandString, connection);
- SqlDataReader sdr = cmd.ExecuteReader();
- if (sdr.Read())
- {
- Label1.Text = sdr.GetValue(1).ToString();
- Label3.Text = sdr.GetValue(27).ToString();
- if (sdr.GetInt32(3) == 0)
- Label2.Text = "男";
- else
- Label2.Text = "女";
- Label4.Text = sdr.GetValue(13).ToString();
- Label6.Text = sdr.GetValue(7).ToString();
- string path = sdr.GetValue(12).ToString();
- Image1.ImageUrl = sdr.GetValue(12).ToString();
- }
- sdr.Close();
- commandString = "SELECT avg_point FROM stu_id_num WHERE stu_id_num.stu_id=" + stu_ID;
- SqlCommand cmd1 = new SqlCommand(commandString, connection);
- SqlDataReader sdr1 = cmd1.ExecuteReader();
- if (sdr1.Read())
- {
- Label5.Text = sdr1.GetDecimal(0).ToString();
- }
- sdr1.Close();
- connection.Close();
- }
- }