⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 luru.aspx.cs

📁 学籍管理系统能够完成对学生信息的填加,删除,修改等功能.
💻 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;

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

    }
   
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        try
    {
        SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "Data source=.;Database=xueji;Integrated Security=SSPI";
            conn.Open();
            String sql = "insert into student(id,name,sex,adress,birth,sfid,adept,subject,class1,email,tel,beizhu)" + "values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + RadioButtonList1.SelectedValue + "','" + TextBox3.Text + "','" + DropDownList1.SelectedValue + DropDownList2.SelectedValue + DropDownList3.SelectedValue + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox10.Text + "','" + TextBox8.Text + "','" + TextBox12.Text + "')";
            SqlCommand comm = new SqlCommand(sql, conn);
            int a = comm.ExecuteNonQuery();
            if (a!= 0)
               Label6.Text = "成功录入";
            conn.Close();
            }
          catch
            {
              
              Response.Write("<script>alert('用户已存在!')</script>");
          }
   }


   
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -