mentorList.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 student_mentorList : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- string teacher_id = Request.QueryString["tea_Id"];
- string userId = "63081500007";
- SqlConnection connection = DB.connect_la();
- connection.Open();
- //string commandString = "select tea_id from tea_table where tea_name = " + tea_name;
- //SqlCommand cmd1 = new SqlCommand(commandString, connection);
- //SqlDataReader sdr1 = cmd1.ExecuteReader();
- //if (sdr1.Read())
- // tea_id = sdr1.GetValue(0).ToString();
- //sdr1.Close();
- string commandString = "insert into stu_tea values('" + userId + "','" + teacher_id + "','未选择')";
- SqlCommand cmd = new SqlCommand(commandString, connection);
- try
- {
- cmd.ExecuteNonQuery();
- }
- catch
- {
- Response.Write("<script>window.location='messageBoard.aspx'</script>");
- }
- connection.Close();
- }
- //选择导师按钮
- protected void Button_Click(object sender, EventArgs e)
- {
- //string userId = Session["userId"].ToString();
- }
- }