




已阅读5页,还剩18页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
安徽工业大学工商学院数据库课程设计报告学生信息管理系统 姓名:金村界 学号:141842211 专业:计算机科学与技术 班级:计1441 教师:甘丽2017.1.31、 题目:学生信息管理系统 学生信息管理是一个教育单位不可缺少的部分,它的内容对于学校的决策者和管理者来说都是至关重要的。所以学生信息管理系统应该能够为用户提供充足的信息和快捷的查询手段。本系统采用Microsoft Visual Studio 2010作为开发工具,Microsoft SQL Server 2012建立数据库,并进行初始数据输入,在进行界面的设计和代码的编写,界面简洁,功能明确,方便了工作人员的操作。二、开发工具:Microsoft 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;using 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 sender, 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=.;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, 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(账号或密码错误!, 错误提示, 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.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(object 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 = 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 System.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_CellContentClick(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姓名,性别,专业,班级Fromstuwhere学号= + textBox1.Text + ; SqlDataAdapter dr = new SqlDataAdapter(sqlstr,con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1,stu); dataGridView1.DataSource = DataSet1.Tablesstu; private void button2_Click(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 System.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=学生信息管理系统;User id=sa;pwd=167349; SqlConnection con = new SqlConnection(str); String sqlstr = Select姓名,性别,专业,班级Fromstuwhere学号= + textBox1.Text + ; SqlDataAdapter dr = new SqlDataAdapter(sqlstr, con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1, stu); dataGridView1.DataSource = DataSet1.Tablesstu; private void button2_Click(object sender, EventArgs e) string str = Server=.;Database=学生信息管理系统;User id=sa;pwd=167349; SqlConnection con = new SqlConnection(str); String sqlstr = deleteFromstuwhere学号= + textBox1.Text + ; SqlCommand mycom2 = new SqlCommand(sqlstr, con); con.Open(); mycom2.ExecuteNonQuery(); MessageBox.Show(该学生信息删除成功!, 恭喜, MessageBoxButtons.OK, 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.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 Form6 : Form public Form6() InitializeComponent(); private void groupBox1_Enter(object sender, 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=167349; SqlConnection con = new SqlConnection(str); String sqlstr = updatestuset学号= + textBox2.Text + ,姓名= + textBox3.Text + ,性别= + Sex + ,专业= + textBox6.Text + ,年龄= + textBox5.Text + ,班级= + textBox4.Text + Where学号= + textBox1.Text + ; SqlCommand mycom1 = new SqlCommand(sqlstr, con); con.Open(); mycom1.ExecuteNonQuery(); MessageBox.Show(该学生信息更新成功!, 恭喜, MessageBoxButtons.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学号,姓名,专业,性别,年龄,班级Fromstuwhere学号= + textBox1.Text + ; SqlDataAdapter dr = new SqlDataAdapter(sqlstr, con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1, stu); dataGridView1.DataSource = DataSet1.Tablesstu; private void button3_Click_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;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 SqlCo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 购买液压拖车合同范本
- 帮带宠物出境合同范本
- 合伙开火锅店合作协议书2篇
- 高压注水泵房配电设备维修技术协议3篇
- 考勤工作心得体会怎么写(范文10篇)
- 指导性案例的题目及答案
- 八月一日讲话参考
- 旅游行业活动策划攻略
- 2025年事业单位工勤技能考试考试题库及参考答案
- CN222980410U 一种静簧与线圈架装配结构及拍合式继电器 (四川宏发电声有限公司)
- 2025年威海桃威铁路有限公司招聘笔试参考题库含答案解析
- 妊娠期高血压疾病的观察及护理
- 医院DIP支付方式改革工作实施方案
- 完成筹备申请正式设立高等职业学校的审批办理流程
- 手足显微外科护理常规
- 《开关培训》课件
- 俄乌冲突课件初中生
- 【初中英语】15天背完英语3500词
- 2024上海中考考纲单词
- 《激光原理及应用》全套课件
- 成人高考成考大学语文(专升本)试题及答案指导(2025年)
评论
0/150
提交评论