




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 安徽工业大学工商学院数据库课程设计报告学生信息管理系统 姓名:金村界 学号:141842211 专业:计算机科学与技术 班级:计1441 教师:甘丽1、 题目:学生信息管理系统 学生信息管理是一个教育单位不可缺少的部分,它的内容对于学校的决策者和管理者来说都是至关重要的。所以学生信息管理系统应该能够为用户提供充足的信息和快捷的查询手段。本系统采用Microsoft Visual Studio 2010作为开发工具,Microsoft SQL Server 2012建立数据库,并进行初始数据输入,在进行界面的设计和代码的编写,界面简洁,功能明确,方便了工作人员的操作。二、开发工具:Micros
2、oft Visual Studio 2010三、数据库:Microsoft SQL Server 2012 Microsoft SQL Server 2012是一套完整的数据库和分析产品,具有高度的可扩展性和可靠性,对市场的快速反应能力强,可以快速构建各种业务和方案,具有高度的安全性保障。四、操作系统:Microsoft windows 10五、功能图登录添加更改删除 查询6、 用户视图与代码1、登录页面using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;usin
3、g System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 测试 public partial class Form1 : Form public Form1() InitializeComponent(); private void label1_Click(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object se
4、nder, EventArgs e) if (comboBox1.Text = "学生") pictureBox1.Image = Image.FromFile("pic1.jpg"); if (comboBox1.Text = "教师") pictureBox1.Image = Image.FromFile("pic2.jpg"); private void button2_Click(object sender, EventArgs e) string str, sql; str = "Server=
5、.;Database=学生信息管理系统;User id='sa'pwd='167349'" SqlConnection conn = new SqlConnection(str); conn.Open(); sql = "select * from 教师登入表 where zh='" + textBox1.Text + "' and mima='" + textBox2.Text + "'" SqlCommand cmd = new SqlCommand(sql
6、, conn); cmd.CommandType = CommandType.Text; SqlDataReader sdr; sdr = cmd.ExecuteReader(); if (sdr.Read() && comboBox1.Text = "教师") Form3 form2 = new Form3(); form2.Show(); else if (comboBox1.Text = "请选择") MessageBox.Show("未选择登录选项"); else MessageBox.Show("账
7、号或密码错误!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error); private void button3_Click(object sender, EventArgs e) this.Dispose(); 2、功能页面 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.
8、Text;using System.Windows.Forms;namespace 测试 public partial class Form3 : Form public Form3() InitializeComponent(); private void radioButton1_CheckedChanged(object sender, EventArgs e) private void radioButton2_CheckedChanged(object sender, EventArgs e) private void radioButton3_CheckedChanged(obje
9、ct sender, EventArgs e) private void radioButton4_CheckedChanged(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e) if (radioButton1.Checked) Form4 f = new Form4(); f.Show(); if (radioButton2.Checked) Form5 f = new Form5(); f.Show(); if (radioButton3.Checked) Form6 f
10、= new Form6(); f.Show(); if (radioButton4.Checked) Form7 f = new Form7(); f.Show(); private void button1_Click(object sender, EventArgs e) this.Dispose(); private void groupBox1_Enter(object sender, EventArgs e) private void label2_Click(object sender, EventArgs e) 系统功能:(1) 查询 using System;using Sys
11、tem.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 测试 public partial class Form4 : Form public Form4() InitializeComponent(); private void dataGridView1_CellCo
12、ntentClick(object sender, DataGridViewCellEventArgs e) private void button1_Click(object sender, EventArgs e) /查询 string str = "Server=.;Database=学生信息管理系统;User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "Select 姓名,性别,专业,班级
13、0;From stu where 学号 = '" + textBox1.Text + "'" SqlDataAdapter dr = new SqlDataAdapter(sqlstr,con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1,"stu"); dataGridView1.DataSource = DataSet1.Tables"stu" private void button2_Click
14、(object sender, EventArgs e) this.Dispose(); private void button3_Click(object sender, EventArgs e) Form3 thild = new Form3(); thild.Show(); this.Dispose(); private void Form4_Load(object sender, EventArgs e) (2) 删除 using System;using System.Collections.Generic;using System.ComponentModel;using Syst
15、em.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 测试 public partial class Form5 : Form public Form5() InitializeComponent(); private void button1_Click(object sender, EventArgs e) string str = "Server=.;Database=学生信
16、息管理系统;User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "Select 姓名,性别,专业,班级 From stu where 学号 = '" + textBox1.Text + "'" SqlDataAdapter dr = new SqlDataAdapter(sqlstr, con); DataSe
17、t DataSet1 = new DataSet(); dr.Fill(DataSet1, "stu"); dataGridView1.DataSource = DataSet1.Tables"stu" private void button2_Click(object sender, EventArgs e) string str = "Server=.;Database=学生信息管理系统;User id='sa'pwd='167349'" SqlConnection con = new SqlCon
18、nection(str); String sqlstr = "delete From stu where 学号='" + textBox1.Text + "'" SqlCommand mycom2 = new SqlCommand(sqlstr, con); con.Open(); mycom2.ExecuteNonQuery(); MessageBox.Show("该学生信息删除成功!", "恭喜", MessageBoxButtons.OK,
19、MessageBoxIcon.Information); private void button3_Click(object sender, EventArgs e) Form3 thild = new Form3(); thild.Show(); this.Dispose(); private void button4_Click(object sender, EventArgs e) this.Dispose(); private void Form5_Load(object sender, EventArgs e) (3) 更改 using System;using System.Col
20、lections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 测试 public partial class Form6 : Form public Form6() InitializeComponent(); private void groupBox1_Enter(object send
21、er, EventArgs e) private void textBox2_TextChanged(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e) String Sex; if (radioButton1.Checked = true) Sex = "男" else Sex = "女" string str = "Server=.;Database=学生信息管理系统;User id='sa'pwd='1
22、67349'" SqlConnection con = new SqlConnection(str); String sqlstr = "update stu set 学号='" + textBox2.Text + "' ,姓名='" + textBox3.Text + "',性别='" + Sex + "',专业='" + textBox6.Text + "',年龄='&qu
23、ot; + textBox5.Text + "',班级='" + textBox4.Text + "' Where 学号='" + textBox1.Text + "'" SqlCommand mycom1 = new SqlCommand(sqlstr, con); con.Open(); mycom1.ExecuteNonQuery(); MessageBox.Show("该学生信息更新成功!", "恭喜", MessageBoxB
24、uttons.OK, MessageBoxIcon.Information); con.Close(); private void button1_Click(object sender, EventArgs e) string str = "Server=.;Database=学生信息管理系统;User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "Select 学号,姓名,专业,性别,年龄,班级
25、0;From stu where 学号 = '" + textBox1.Text + "'" SqlDataAdapter dr = new SqlDataAdapter(sqlstr, con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1, "stu"); dataGridView1.DataSource = DataSet1.Tables"stu" private void button3_Cli
26、ck_1(object sender, EventArgs e) Form3 fiveth = new Form3(); fiveth.Show(); this.Dispose(); private void Form6_Load(object sender, EventArgs e) (4) 添加 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;
27、using System.Windows.Forms;using System.Data.SqlClient;namespace 测试 public partial class Form7 : Form public Form7() InitializeComponent(); private void label1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) String Sex; if (radioButton1.Checked = true) Sex = "男" else Sex = "女" string str = "Server=.;Database=学生信息管理系统;User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "insert into stu(学号,姓名,性别,专业,年龄,班级)
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- T/CATEA 005-2023丘陵坡地甘蔗机械化收获技术规程
- T/CAQP 002-2017汽车零部件仓储信息追溯编码规范
- T/CAQI 66-2019车载空气净化器
- T/CAQI 315-2023山区多级一体化供水泵站技术规范
- T/CAQI 200-2021小型清洁生物质采暖炉具
- 2024年度江苏省二级建造师之二建矿业工程实务模拟试题(含答案)
- 尔雅茶艺考试题及答案
- T/CAFFCI 68-2023化妆品滋养功效测试方法
- 机场领导面试题及答案
- 导播岗位考试题及答案
- JBK-698CX淬火机数控系统
- ZJUTTOP100理工类学术期刊目录(2018年版)
- 道路交通事故现场勘查课件
- 门店电表记录表
- 心理学在船舶安全管理中的应用
- JJF(鄂) 90-2021 电子辊道秤校准规范(高清版)
- 超星尔雅学习通《今天的日本》章节测试含答案
- 组态王双机热备
- 餐饮量化分级
- 三一重工SCC2000履带吊履带式起重机技术参数
- [精品]GA38-2004《银行营业场所风险等级和防护级别的规定》
评论
0/150
提交评论