XDF/StudentRegister.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace XDF
{
    public partial class StudentRegister : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        
       

        

        private string  getNumber(string baseID,string date)
        {
            string result = "";
            try
            {
                // 1. 创建连接
                SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["XDF"].ConnectionString);

                // 2. 打开连接
                connection.Open();

                // 2.1 创建命令对象
                SqlCommand command = null;
                

                command = new SqlCommand("select count(StuID) from Student where LEFT(StuID,12)=@BaseID+@Date", connection);
               
                command.Parameters.AddWithValue("@BaseID", baseID);
                command.Parameters.AddWithValue("@Date", date);


                // 2.2 执行命令对象
                result = command.ExecuteScalar().ToString();

                // 3. 关闭连接
                connection.Close();
            }
            catch (Exception e)
            {
                ;
            }

            return result;
        }

        
后面还有 40 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。