国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

數(shù)據(jù)庫課程設(shè)計——學(xué)生信息管理系統(tǒng)(Sqlserver,C#,Winform)

這篇具有很好參考價值的文章主要介紹了數(shù)據(jù)庫課程設(shè)計——學(xué)生信息管理系統(tǒng)(Sqlserver,C#,Winform)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

目錄

需求分析

一.登錄功能

二.注冊功能

三.管理員登錄后跳轉(zhuǎn)到功能頁面:

四.學(xué)生信息管理(主界面,刪除功能在主界面代碼中)

五.學(xué)生信息添加和修改(設(shè)計在一個頁面上,修改需要選中行)

六.課程信息管理(刪除功能在主界面中)

?七.課程信息添加和修改

?八.成績信息管理(刪除功能在主界面代碼中)

九.成績信息添加和修改

十.數(shù)據(jù)庫設(shè)計


https://github.com/2736933896/StudentSystem,報告,項目源碼,數(shù)據(jù)庫設(shè)計,窗體設(shè)計源碼上傳到github,需要的同學(xué)自行下載哦

需求分析

1.1設(shè)計可視化界面,具有身份驗證功能,需要登錄時輸入賬號及密碼。

1.2學(xué)生用戶能夠注冊自己的賬號,添加自己的基本注冊信息:學(xué)號、密碼、姓名、性別,對于學(xué)生除了基本注冊信息外,還包括學(xué)生個人信息、課程信息、學(xué)生成績信息。

1.3學(xué)生信息、課程信息、學(xué)生成績都能實現(xiàn)增刪改查并且符合符合數(shù)據(jù)庫完整性。

(其他圖文內(nèi)容省略了,需要課程報告的私聊我)

一.登錄功能

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;

namespace StudentSY
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 

        private void timer3_Tick(object sender, EventArgs e)
        {

           if(pictureBox2.Location.X<200)
            {
                pictureBox2.Location = new Point(pictureBox2.Location.X + 2, pictureBox2.Location.Y);
            }
           else
            {
                if(comboBox1.Text=="學(xué)生")
                {
                    Form4 form4 = new Form4();
                    form4.Show();
                }            
                timer3.Stop();
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            if(login())
            {
                timer3.Start();
                textBox3.Visible = false;
                textBox4.Visible = false;
                comboBox1.Visible = false;
                button3.Visible = false;
                button4.Visible = false;
                button5.Visible = false;
                label4.Visible = false;
                label5.Visible = false;
                label6.Visible = false;
            }
        }

        private bool login()
        {
            if(textBox3.Text==null|| textBox4.Text==null)
            {
                MessageBox.Show("登錄失敗,賬號或者密碼為空","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                return false;
            }
            else if (comboBox1.Text == "學(xué)生")
            {
                string sql = "select * from StudentUser where ID='" + textBox3.Text + "'and PassWord='" + textBox4.Text + "'";
                Dao dao = new Dao();
                IDataReader dr = dao.read(sql);
                if(dr.Read())
                {
                    return true;
                }
                else
                {
                    MessageBox.Show("登錄失敗!賬號或者密碼錯誤,請重試");
                    return false;
                }
            }
            return false;
        }
        private void button4_Click(object sender, EventArgs e)
        {
            textBox3.Text = null;
            textBox4.Text = null;
            comboBox1.Text = null;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Form11 form11 = new Form11();
            form11.ShowDialog();
        }
        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label7_Click(object sender, EventArgs e)
        {

        }

        
    }
}

二.注冊功能

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentSY
{
    public partial class Form11 : Form
    {
        public Form11()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text==""|| textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" )
            {
                MessageBox.Show("輸入不完整,有空項,請檢查!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
            }
            else
            {
                string sql= "insert into StudentUser values('" + textBox1.Text + "', '" + textBox2.Text + "', '" + textBox3.Text + "', '" + textBox4.Text + "')";
                Dao dao = new Dao();
                int i = dao.Excute(sql);
                if(i>0)
                {
                    MessageBox.Show("添加成功");
                    this.Close();
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = null;
            textBox2.Text = null;
            textBox3.Text = null;
            textBox4.Text = null;
        }
    }
}

三.管理員登錄后跳轉(zhuǎn)到功能頁面:

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentSY
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
            toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
            timer1.Start();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 form2 = new Form2();
            form2.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form3 form3 = new Form3();
            form3.ShowDialog();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Form31 form31 = new Form31();
            form31.ShowDialog();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}

四.學(xué)生信息管理(主界面,刪除功能在主界面代碼中)

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentSY
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
            toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
            timer1.Start();
            Table();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
        }

        public  void Table() //讀取數(shù)據(jù)
        {
            string sql = "select * from Student";
            Dao dao = new Dao();
            IDataReader dr = dao.read(sql);
            while(dr.Read())
            {
                string Sno;
                string Sname;
                string Ssex, Sage, Sdept;
                Sno = dr["Sno"].ToString();
                Sname = dr["Sname"].ToString();
                Ssex = dr["Ssex"].ToString();
                Sage = dr["Sage"].ToString();
                Sdept = dr["Sdept"].ToString();
                string[] str = { Sno, Sname, Ssex, Sage, Sdept };
                dataGridView1.Rows.Add(str);
            }
            dr.Close();
        }
        
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Black;
        }

        private void dataGridView1_RowDefaultCellStyleChanged(object sender, DataGridViewRowEventArgs e)
        {
           ForeColor = Color.Black;
        }

        private void 添加學(xué)生ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form21 form21 = new Form21();
            form21.ShowDialog();  //開一個新窗口;
            dataGridView1.Rows.Clear();
            Table();
        }

        private void 修改學(xué)生信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {


                string[] str = { dataGridView1.SelectedCells[0].Value.ToString(), dataGridView1.SelectedCells[1].Value.ToString(),
                dataGridView1.SelectedCells[2].Value.ToString(),dataGridView1.SelectedCells[3].Value.ToString(),
                dataGridView1.SelectedCells[4].Value.ToString()};
                // MessageBox.Show(str[0]+str[1]+str[2]+str[3]+str[4]);
                Form21 form21 = new Form21(str);
                form21.ShowDialog();
                dataGridView1.Rows.Clear();
                Table();
            }
            catch
            {
                MessageBox.Show("未正確選中行,請重試");
            }
        }

        private void 刪除學(xué)生信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("確定要刪除嗎?", "提示", MessageBoxButtons.OKCancel);
            if(r==DialogResult.OK)
            {
                try
                {
                    string id, name;
                    id = dataGridView1.SelectedCells[0].Value.ToString(); //選中當(dāng)前行第一列的值
                    name = dataGridView1.SelectedCells[0].Value.ToString();
                    string sql = "delete from Student where Sno=" + id;
                    Dao dao = new Dao();
                    int i = dao.Excute(sql); //執(zhí)行SQL語句
                    if(i>0)
                    {
                        dataGridView1.Rows.Clear();
                        Table();
                    }
                }

                catch
                {
                    MessageBox.Show("請正確選擇行");
                }
            }
           
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Table();
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            添加學(xué)生ToolStripMenuItem_Click(sender, e);
        }
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            刪除學(xué)生信息ToolStripMenuItem_Click(sender, e);
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            修改學(xué)生信息ToolStripMenuItem_Click(sender, e);

;        }
    }
}

五.學(xué)生信息添加和修改(設(shè)計在一個頁面上,修改需要選中行)

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserverwinform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentSY
{
    public partial class Form21 : Form
    {
        string []str = new string[5];
        public Form21()
        {
            InitializeComponent();
            button1.Text = "添加信息"; //更改button的值,用于增加和修改信息
        }

        public Form21(string[] a)
        {
            InitializeComponent();
            button1.Text = "修改信息";
            for(int i =0;i<5;i++)
            {
                str[i] = a[i];
            }
            textBox1.Text = str[0];
            textBox2.Text = str[1];
            textBox3.Text = str[2];
            textBox4.Text = str[3];
            textBox5.Text = str[4];
           // this.Close();
        }
        private void Form21_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (button1.Text == "添加信息")
            {
                if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "")
                {
                    MessageBox.Show("輸入不完整,不能為空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string sql = "insert into Student Values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "')";

                    MessageBox.Show(sql);
                    Dao dao = new Dao();
                    int i = dao.Excute(sql);
                    if (i > 0)
                    {
                        MessageBox.Show("添加成功");
                        this.Close();
                    }
                
                }
            }
            else if (button1.Text == "修改信息")
            {
                if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "")
                {
                    MessageBox.Show("修改后有空項,請檢查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string sql = "update Student set Sno='"+textBox1.Text+"' ,Sname ='"+textBox2.Text+"',Ssex='"+textBox3.Text+"',Sage='"+textBox4.Text+"',Sdept='"+textBox5.Text+"' where Sno = '" + str[0] +"';";
                    Dao dao = new Dao();
                    int i = dao.Excute(sql);
                    if (i > 0)
                    {
                        MessageBox.Show("修改成功");
                        this.Close();
                    }
                }
            }

        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

六.課程信息管理(刪除功能在主界面中)

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentSY
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
            toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
            timer1.Start();
            Table();
        }

        public void Table()
        {
            string sql = "select * from Course";
            Dao dao = new Dao();
            IDataReader dr = dao.read(sql);
            while (dr.Read())
            {
                string Cno, Cname, Cpno, Credit;
                Cno = dr["Cno"].ToString();
                Cname = dr["Cname"].ToString();
                Cpno = dr["Cpno"].ToString();
                Credit = dr["Credit"].ToString();
                string[] str = { Cno, Cname, Cpno, Credit };
                dataGridView1.Rows.Add(str);
            }
            dr.Close();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
        }

        private void 添加課程ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addcourse addcourse = new addcourse();
            addcourse.ShowDialog();
            dataGridView1.Rows.Clear();
            Table();
        }
        private void 修改課程ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string[] str = { dataGridView1.SelectedCells[0].Value.ToString(), dataGridView1.SelectedCells[1].Value.ToString(),
                dataGridView1.SelectedCells[2].Value.ToString(),dataGridView1.SelectedCells[3].Value.ToString()};
                addcourse addcourse = new addcourse(str);
                addcourse.ShowDialog();
                dataGridView1.Rows.Clear();
                Table();
            }
            catch
            {
                MessageBox.Show("未正確選擇行,請重試");
            }
        }
       

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Table();
        }

        private void 刪除課程ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("確定要刪除嗎?", "提示", MessageBoxButtons.OKCancel);
            if (r == DialogResult.OK)
            {
                try
                {
                    string id;
                    id = dataGridView1.SelectedCells[0].Value.ToString(); //選中當(dāng)前行第一列的值
                  //  name = dataGridView1.SelectedCells[0].Value.ToString();
                    string sql = "delete from Course where Cno=" + id;
                    Dao dao = new Dao();
                    int i = dao.Excute(sql); //執(zhí)行SQL語句
                    if (i > 0)
                    {
                        dataGridView1.Rows.Clear();
                        Table();
                    }
                }

                catch
                {
                    MessageBox.Show("請正確選擇行");
                }
            }
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            添加課程ToolStripMenuItem_Click(sender, e);
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            修改課程ToolStripMenuItem_Click(sender, e);
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            刪除課程ToolStripMenuItem_Click(sender, e);
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

       
    }
}

?七.課程信息添加和修改

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserverwinform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace StudentSY
{
    public partial class addcourse : Form
    {
        string[] str=new string[4];
        public addcourse()
        {
            InitializeComponent();
            button1.Text = "添加信息";

        }

        public addcourse(string[] a)
        {
            InitializeComponent();
            button1.Text = "修改信息";
            for (int i = 0; i < 4; i++)
            {
                str[i] = a[i];
            }
            textBox1.Text = str[0];
            textBox2.Text = str[1];
            textBox3.Text = str[2];
            textBox4.Text = str[3];
         
            // this.Close();
        }

       
        private void button1_Click(object sender, EventArgs e)
        {
                if (button1.Text == "添加信息")
                {
                    if (textBox1.Text == "" || textBox2.Text == ""  || textBox4.Text == "")
                    {
                        MessageBox.Show("除先修課外輸入不完整,不能為空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        string sql = "insert into Course Values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')";

                        MessageBox.Show(sql);
                        Dao dao = new Dao();
                        int i = dao.Excute(sql);
                        if (i > 0)
                        {
                            MessageBox.Show("添加成功");
                            this.Close();
                        }

                    }
                }
                else if (button1.Text == "修改信息")
                {
                    if (textBox1.Text == "" || textBox2.Text == "" ||  textBox4.Text == "" )
                    {
                        MessageBox.Show("除先修課外修改后有空項,請檢查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        string sql = "update Course set Cno='" + textBox1.Text + "' ,Cname ='" + textBox2.Text + "',Cpno='" + textBox3.Text + "',Credit='" + textBox4.Text + "'  where Cno = '" + str[0] + "';";
                        Dao dao = new Dao();
                        int i = dao.Excute(sql);
                        if (i > 0)
                        {
                            MessageBox.Show("修改成功");
                            this.Close();
                        }
                    }
                }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }


    }
}

?八.成績信息管理(刪除功能在主界面代碼中)

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentSY
{
    public partial class Form31 : Form
    {
        public Form31()
        {
            InitializeComponent();
            Table();
        }

        public void Table()
        {
            string sql = "select * from SC";
            Dao dao = new Dao();
            IDataReader dr = dao.read(sql);
            while (dr.Read())
            {
                string Sno,Cno,Grade;
                Sno = dr["Sno"].ToString();
                Cno = dr["Cno"].ToString();
                Grade = dr["Grade"].ToString();
                string[] str = { Sno,Cno, Grade};
                dataGridView2.Rows.Add(str);
            }
            dr.Close();
        }

        private void 添加成績ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addgrade addgrade = new addgrade();
            addgrade.ShowDialog();
            dataGridView2.Rows.Clear();
            Table();
        }

        private void 刪除成績ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("確定要刪除嗎?", "提示", MessageBoxButtons.OKCancel);
            if (r == DialogResult.OK)
            {
                try
                {
                    string sno,cno;
                    sno = dataGridView2.SelectedCells[0].Value.ToString(); //選中當(dāng)前行第一列的值
                    cno= dataGridView2.SelectedCells[1].Value.ToString();                                             //  name = dataGridView1.SelectedCells[0].Value.ToString();
                    string sql = "delete from SC where Sno= '"+sno+"' and Cno='"+cno+"'";
                    Dao dao = new Dao();
                    int i = dao.Excute(sql); //執(zhí)行SQL語句
                    if (i > 0)
                    {
                        dataGridView2.Rows.Clear();
                        Table();
                    }
                }

                catch
                {
                    MessageBox.Show("請正確選擇行");
                }
            }
        }

        private void 修改成績ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string[] str = { dataGridView2.SelectedCells[0].Value.ToString(), dataGridView2.SelectedCells[1].Value.ToString(),
                dataGridView2.SelectedCells[2].Value.ToString()};
                addgrade addgrade = new addgrade(str);
                addgrade.ShowDialog();
                dataGridView2.Rows.Clear();
                Table();
            }
            catch
            {
                MessageBox.Show("未正確選擇行,請重試");
            }
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            添加成績ToolStripMenuItem_Click(sender, e);
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            修改成績ToolStripMenuItem_Click(sender, e);
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            刪除成績ToolStripMenuItem_Click(sender, e);
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            dataGridView2.Rows.Clear();
            Table();
        }

        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}

九.成績信息添加和修改

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserverwinform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace StudentSY
{
    public partial class addgrade : Form
    {
        string []str = new string[3];
        public addgrade()
        {
            InitializeComponent();
            button1.Text = "添加信息";
        }

        public addgrade(string[] a)
        {
            InitializeComponent();
            button1.Text = "修改信息";
            for (int i = 0; i < 3; i++)
            {
                str[i] = a[i];
            }
            textBox1.Text = str[0];
            textBox2.Text = str[1];
            textBox3.Text = str[2];
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (button1.Text == "添加信息")
            {
                if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
                {
                    MessageBox.Show("輸入不完整,不能為空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string sql = "insert into SC Values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')";

                    MessageBox.Show(sql);
                    Dao dao = new Dao();
                    int i = dao.Excute(sql);
                    if (i > 0)
                    {
                        MessageBox.Show("添加成功");
                        this.Close();
                    }

                }
            }
            else if (button1.Text == "修改信息")
            {
                if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
                {
                    MessageBox.Show("修改后有空項,請檢查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string sql = "update SC set Grade='" + textBox3.Text + "'  where Sno = '" + str[0] + "' and Cno ='" + str[1] +"';";
                    Dao dao = new Dao();
                    int i = dao.Excute(sql);
                    if (i > 0)
                    {
                        MessageBox.Show("修改成功");
                        this.Close();
                    }
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

十.數(shù)據(jù)庫設(shè)計

USE MySchool;
DROP TABLE IF EXISTS SC       /*成績*/
DROP TABLE IF EXISTS Student  /*學(xué)生信息*/
DROP TABLE IF EXISTS Course   /*課程*/
DROP TABLE IF EXISTS StudentUser  /*學(xué)生用戶信息*/
DROP TABLE IF EXISTS Administrator  /*管理員用戶信息*/
DROP TABLE IF EXISTS SysLog   /*注冊日志*/
DROP TABLE IF EXISTS SysLog1   /*登陸日志*/
DROP TABLE IF EXISTS AVG1   /*平均成績*/

Create table StudentUser  --學(xué)生注冊信息表格
(ID nchar(20) primary key,
 PassWord nchar(32),
 Name nchar(20),
 Sex nchar(2),
 );

 Create table Administrator  --管理員注冊信息表格
 (
 ID char(20) primary key,
 PassWord nchar(32),
 Name nchar(20),
 Sex char(2),
-- Birthday datetime ,
 --UserMobile nchar(11),
 );

Create table Student      --學(xué)生信息表格
(
Sno char(9) primary key,  --列級完整性約束條件,Sno是主碼
Sname char(20) Unique,    --名字唯一
Ssex char(2),
Sage int,
Sdept char(20),
);

Create table Course
(
Cno char(9) primary key,  --列級完整性約束條件,Cno是主碼
Cname char(40),
cpno char(4),
Credit int,
);

 
create table  SC
 (
 Sno char(9), 
 Cno char(9),  
 Grade int,
 primary key (Sno,Cno),                     --主碼由兩個屬性構(gòu)成,必須作為表級完整性進(jìn)行定義
 foreign key (Sno) references Student(Sno),  --表級完整性約束條件,Sno是外碼,被參照表是Student 
 foreign key (Cno) references Course(Cno)     --表級完整性約束條件, Cno是外碼,被參照表是Course
 ); 
INSERT  INTO  StudentUser VALUES ('2023123','123456','張三','男');
INSERT  INTO  Administrator VALUES ('2023124','123456','張三','男');
INSERT  INTO  Administrator VALUES ('2023125','123456','張三','男');
 
 
INSERT  INTO  Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215121','李勇','男','CS',20);
INSERT  INTO  Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215122','劉晨','女','CS',19);
INSERT  INTO  Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215123','王敏','女','MA',18);
INSERT  INTO  Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215125','張立','男','IS',19);
INSERT  INTO  Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215128','陳冬','男','IS',20);
 
SELECT * FROM Student
 
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('1','數(shù)據(jù)庫',NULL,4);
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('2','數(shù)學(xué)',NULL,4);
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('3','信息系統(tǒng)',NULL,4);
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('4','操作系統(tǒng)',NULL,4);
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('5','數(shù)據(jù)結(jié)構(gòu)',NULL,4);
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('6','數(shù)據(jù)處理',NULL,4);
INSERT  INTO Course(Cno,Cname,Cpno,Credit)	VALUES ('7','Pascal語言',NULL,4);
 
UPDATE Course SET Cpno = '5' WHERE Cno = '1' 
UPDATE Course SET Cpno = '1' WHERE Cno = '3' 
UPDATE Course SET Cpno = '6' WHERE Cno = '4' 
UPDATE Course SET Cpno = '7' WHERE Cno = '5' 
UPDATE Course SET Cpno = '6' WHERE Cno = '7' 
 
SELECT * FROM Course
 
INSERT  INTO SC(Sno,Cno,Grade) VALUES ('201215121 ','1',92);
INSERT  INTO SC(Sno,Cno,Grade) VALUES ('201215121 ','2',85);
INSERT  INTO SC(Sno,Cno,Grade) VALUES ('201215121 ','3',88);
INSERT  INTO SC(Sno,Cno,Grade) VALUES ('201215122 ','2',90);
INSERT  INTO SC(Sno,Cno,Grade) VALUES ('201215122 ','3',80);
 
SELECT * FROM SC

CREATE TABLE AVG1
	(
		Cname CHAR(10),   /* 科目*/	
		avg1 INT
	);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('數(shù)據(jù)庫',NULL);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('數(shù)學(xué)',NULL);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('信息系統(tǒng)',NULL);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('操作系統(tǒng)',NULL);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('數(shù)據(jù)結(jié)構(gòu)',NULL);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('數(shù)據(jù)處理',NULL);
INSERT  INTO AVG1(Cname,avg1)	VALUES ('Pascal語言',NULL);

學(xué)生信息表(Student):
winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

課程表(Course):
winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

成績表(SC):

winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

學(xué)生用戶表(StudentUser):
winform課程設(shè)計,項目制作,數(shù)據(jù)庫,c#,sqlserver

?有需要完整代碼和實驗報告的同學(xué)私聊我,有什么問題評論文章來源地址http://www.zghlxwxcb.cn/news/detail-786304.html

到了這里,關(guān)于數(shù)據(jù)庫課程設(shè)計——學(xué)生信息管理系統(tǒng)(Sqlserver,C#,Winform)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計--藥品存儲信息管理系統(tǒng)

    數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計--藥品存儲信息管理系統(tǒng)

    1.1項目提出 1.2.調(diào)查使用該藥品存儲信息數(shù)據(jù)庫的用戶的實際需求 1.3 功能需求 1.供應(yīng)商基本信息模塊,完成對供應(yīng)商基本信息的輸入、修改和查詢; 2.員工基本信息模塊,完成對員工基本情況的輸入、修改和查詢; 3.藥品基本信息模塊,完成對藥品基本信息的輸入、修改

    2024年02月08日
    瀏覽(35)
  • 【數(shù)據(jù)庫技術(shù)課程設(shè)計】 電信學(xué)院考研信息管理系統(tǒng) +【Visual FoxPro】

    【數(shù)據(jù)庫技術(shù)課程設(shè)計】 電信學(xué)院考研信息管理系統(tǒng) +【Visual FoxPro】

    一 、系統(tǒng)設(shè)計背景? ? ? ? 二、系統(tǒng)可行性分析 2.1?經(jīng)濟(jì)可行性 2.2?技術(shù)可行性 2.3?操作可行性 2.4?可行性分析總結(jié) 三、軟件選擇與編程環(huán)境 3.1 軟件選擇 3.2 編程環(huán)境 四、系統(tǒng)總體結(jié)構(gòu)設(shè)計 五、數(shù)據(jù)庫設(shè)計及表鏈接 5.1 表設(shè)計 5.2 表連接 六、信息瀏覽的實現(xiàn) 6.1?表單設(shè)計

    2024年02月04日
    瀏覽(21)
  • [Python+Django]Web學(xué)生信息管理系統(tǒng)數(shù)據(jù)庫設(shè)計及系統(tǒng)實現(xiàn)

    [Python+Django]Web學(xué)生信息管理系統(tǒng)數(shù)據(jù)庫設(shè)計及系統(tǒng)實現(xiàn)

    本文我們完成數(shù)據(jù)的設(shè)計,并通過Django框架完成數(shù)據(jù)庫構(gòu)建同時利用Django框架模式實現(xiàn)學(xué)生信息管理系統(tǒng)的功能。 簡單的包裝下畢設(shè)應(yīng)該沒問題了。 Python,Mysql,Pycharm的安裝本文就不做特別介紹了,有需要的同學(xué)請參考如下博文。 Python + Django4 搭建個人博客(二):準(zhǔn)備開

    2024年02月03日
    瀏覽(57)
  • 數(shù)據(jù)庫課程設(shè)計-學(xué)生選課管理系統(tǒng)(實訓(xùn)報告+答辯ppt+源碼+sql文件+打包好的程序)springboot項目-javaweb

    數(shù)據(jù)庫課程設(shè)計-學(xué)生選課管理系統(tǒng)(實訓(xùn)報告+答辯ppt+源碼+sql文件+打包好的程序)springboot項目-javaweb

    作者:ChenZhen 博客地址:https://www.chenzhen.space/ 版權(quán):本文為博主 ChenZhen 的原創(chuàng)文章,本文版權(quán)歸作者所有,轉(zhuǎn)載請附上原文出處鏈接及本聲明。 如果對你有幫助,請給一個小小的star? 源碼加vx : ChenZhen_7 (實訓(xùn)報告+答辯ppt+源碼+sql文件+打包好的程序 無套路 免費獲?。?不放

    2024年02月11日
    瀏覽(29)
  • 學(xué)生信息管理系統(tǒng)(數(shù)據(jù)庫)

    學(xué)生信息管理系統(tǒng)(數(shù)據(jù)庫)

    要求實現(xiàn)功能: (1)學(xué)生、課程、教師等信息的錄入和維護(hù),一門課只由一位教師上,一位教師可上多門課 (2)學(xué)生進(jìn)行選課,一學(xué)期約20學(xué)分 (3)教師在每門課結(jié)束后給出學(xué)生成績,不及格則補(bǔ)考后記錄補(bǔ)考成績 (4)能明細(xì)查詢某學(xué)生的選課情況及某課程的選修學(xué)生情

    2024年02月03日
    瀏覽(29)
  • JAVA學(xué)生信息管理系統(tǒng)(數(shù)據(jù)庫實現(xiàn))

    JAVA學(xué)生信息管理系統(tǒng)(數(shù)據(jù)庫實現(xiàn))

    這次的項目是用數(shù)據(jù)庫實現(xiàn)學(xué)生的信息管理系統(tǒng),有三步組成,寫項目鏈接數(shù)據(jù)庫實現(xiàn)相關(guān)的操作 開發(fā)工具: eclipse、MySQL、navicat、mysql-connector-java-8.0.27 ? ? (1)主頁面 ? (2)添加界面 ? (3)刪除界面 ? ?(4)修改界面 ?(5)查找界面 (6)數(shù)據(jù)庫鏈接 ? 添加Java驅(qū)動包

    2024年02月11日
    瀏覽(32)
  • 學(xué)生信息及成績管理系統(tǒng)(Python+Sqlite)數(shù)據(jù)庫版

    學(xué)生信息及成績管理系統(tǒng)(Python+Sqlite)數(shù)據(jù)庫版

    目錄 功能模塊: 運行功能演示: ?具體代碼實現(xiàn)過程: 創(chuàng)建sqlite?數(shù)據(jù)庫 ?Python代碼 引入os和sqlite3包: 初始化數(shù)據(jù)庫: 連接數(shù)據(jù)庫: 關(guān)閉并提交數(shù)據(jù)到數(shù)據(jù)庫: 查詢數(shù)據(jù)并顯示: 添加并插入數(shù)據(jù)到數(shù)據(jù)庫: 更新數(shù)據(jù)到數(shù)據(jù)庫: 刪除數(shù)據(jù)并更新數(shù)據(jù)庫: ?導(dǎo)入和導(dǎo)出數(shù)據(jù)

    2024年02月04日
    瀏覽(40)
  • 利用java和mysql數(shù)據(jù)庫創(chuàng)建學(xué)生信息管理系統(tǒng)

    利用java和mysql數(shù)據(jù)庫創(chuàng)建學(xué)生信息管理系統(tǒng)

    管理系統(tǒng)的使用可以大大提高我們的工作效率,給我們的生活帶來極大的便利,因此我們在學(xué)習(xí)編程語言的時候大多是要學(xué)習(xí)和實現(xiàn)一個管理系統(tǒng)的創(chuàng)建的。 學(xué)生信息管理系統(tǒng)是進(jìn)一步推進(jìn)學(xué)生學(xué)籍管理規(guī)范化、電子化控制和管理學(xué)生信息的總要舉措。系統(tǒng)針對學(xué)校學(xué)生信息

    2024年02月04日
    瀏覽(34)
  • 數(shù)據(jù)庫系統(tǒng)課程設(shè)計(高校成績管理數(shù)據(jù)庫系統(tǒng)的設(shè)計與實現(xiàn))

    數(shù)據(jù)庫系統(tǒng)課程設(shè)計(高校成績管理數(shù)據(jù)庫系統(tǒng)的設(shè)計與實現(xiàn))

    目錄 1、需求分析 1 1.1 數(shù)據(jù)需求描述 1 1.2 系統(tǒng)功能需求 3 1.3 其他性能需求 4 2、概念結(jié)構(gòu)設(shè)計 4 2.1 局部E-R圖 4 2.2 全局E-R圖 5 2.3 優(yōu)化E-R圖 6 3、邏輯結(jié)構(gòu)設(shè)計 6 3.1 關(guān)系模式設(shè)計 6 3.2 數(shù)據(jù)類型定義 6 3.3 關(guān)系模式的優(yōu)化 8 4、物理結(jié)構(gòu)設(shè)計 9 4.1 聚簇設(shè)計 9 4.2 索引設(shè)計 9 4.3 分區(qū)設(shè)

    2024年02月03日
    瀏覽(29)
  • 數(shù)據(jù)庫課程設(shè)計------書店管理系統(tǒng)

    數(shù)據(jù)庫課程設(shè)計------書店管理系統(tǒng)

    書店會員管理系統(tǒng) 具體的效果圖看博客-----書店管理系統(tǒng)2(https://blog.csdn.net/qq_45981397/article/details/124062654?spm=1001.2014.3001.5502) 需求分析 (1).信息需求 書店的管理人員和員工可以為管理系統(tǒng)添加圖書的購買記錄和退書記錄. 會員可以購買圖書以及退書,工作人員對會員的姓名,

    2024年02月04日
    瀏覽(22)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包