ImageVerifierCode 换一换
格式:DOCX , 页数:47 ,大小:20.89KB ,
资源ID:135260      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-135260.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(学生成绩管理系统课程设计源程序.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

学生成绩管理系统课程设计源程序.docx

1、学生成绩管理系统课程设计源程序关于About.csusing 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.Reflection;namespace 学生成绩管理系统 public partial class About : Form public About() Initial

2、izeComponent(); private void button1_Click(object sender, EventArgs e) this.Close(); private void About_Load(object sender, EventArgs e) 添加课程信息AddCourse.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.T

3、ext;using System.Windows.Forms;using MySql.Data.MySqlClient;namespace 学生成绩管理系统 public partial class AddCourse : Form public AddCourse() InitializeComponent(); private void btnExit_Click(object sender, EventArgs e) this.Close(); private void btnAddCourse_Click(object sender, EventArgs e) string myCon

4、nectionString = Database=student;Data Source=localhost;User Id=root;Password=k6smile20xq; MySqlConnection mycn = new MySqlConnection(myConnectionString); mycn.Open(); string sql; Course course = new Course(); course.Cno = txtCno.Text; course.Cname = txtCname.Text; try sql = select count(*) from cour

5、se where cno= + txtCno.Text + ; MySqlCommand mycm = new MySqlCommand(sql, mycn); MySqlDataReader msdr = mycm.ExecuteReader(); msdr.Read(); int stuCount = msdr.GetInt32(count(*); msdr.Close(); if (stuCount = 0 & txtCname.Text != & txtCno.Text != ) sql = insert into course(cno,cname)values( + course.C

6、no + , + course.Cname + ); MySqlCommand mycm1 = new MySqlCommand(sql, mycn); try mycm1.ExecuteNonQuery(); catch (Exception exception) MessageBox.Show(exception.Message); return; finally mycn.Close(); MessageBox.Show(添加成功!); else if (stuCount = 1 & txtCno.Text != & txtCname.Text != ) /这里需要关闭资源 Messag

7、eBox.Show(该课程的信息已存在,请重新输入!); else /这里需要关闭资源 MessageBox.Show(请输入要添加的信息); msdr.Close(); mycn.Close(); catch (Exception a) Console.WriteLine(a.ToString(); finally txtCno.Text = ; txtCname.Text = ; private void AddCourse_Load(object sender, EventArgs e) 添加学生信息AddStudent.csusing System;using System.Colle

8、ctions.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using MySql.Data.MySqlClient;using System.IO;namespace 学生成绩管理系统 public partial class AddStudent : Form public AddStudent() InitializeComponent(); private v

9、oid AddStudent_Load(object sender, EventArgs e) private void btnCancel_Click(object sender, EventArgs e) this.Close(); private void btnAddStudent_Click(object sender, EventArgs e) string myConnectionString = Database=student;Data Source=localhost;User Id=root;Password=k6smile20xq; MySqlConnection my

10、cn = new MySqlConnection(myConnectionString); mycn.Open(); string sql; /int stuNum = Select count(id) from Student stu = new Student(); stu.Sno = txtSno.Text; stu.Sname = txtName.Text; stu.Age = txtAge.Text; stu.ClassName = txtClassName.Text; stu.Password = txtPassword.Text; stu.Id = txtId.Text; if

11、(rbStuGirl.Checked) stu.Sex = 女?; else if (rbStuBoy.Checked) stu.Sex = 男D; /if (rbStuGirl.Checked) stu.Sex = girl; /else if (rbStuBoy.Checked) stu.Sex = boy; try sql = select count(*) from student where sno= + txtSno.Text + ; MySqlCommand mycm = new MySqlCommand(sql, mycn); MySqlDataReader msdr = my

12、cm.ExecuteReader(); msdr.Read(); int stuCount = msdr.GetInt32(count(*); msdr.Close(); if (stuCount = 0 & txtSno.Text != & txtName.Text != & txtAge.Text != & txtClassName.Text != & txtPassword.Text != & txtId.Text != ) sql = insert into student(sno, sname,sex,age,classname,password,id)values( + stu.S

13、no + , + stu.Sname + , + stu.Sex + , + stu.Age + , + stu.ClassName + , + stu.Password + , + stu.Id + ); Console.WriteLine(sql); MySqlCommand mycm1 = new MySqlCommand(sql, mycn); try mycm1.ExecuteNonQuery(); catch (Exception exception) MessageBox.Show(exception.Message); return; finally msdr.Close();

14、 mycn.Close(); MessageBox.Show(添?加?成?功|!?); else if (stuCount = 1 & txtSno.Text != & txtName.Text != & txtAge.Text != & txtClassName.Text != & txtPassword.Text != & txtId.Text != ) /这里需要关闭资源 MessageBox.Show(该学生的信息已存在); else /这里需要关闭资源 MessageBox.Show(请输入要添加的信息); msdr.Close(); mycn.Close(); catch (Exc

15、eption a) Console.WriteLine(a.ToString(); finally txtSno.Text = ; txtName.Text = ; txtAge.Text = ; txtClassName.Text = ; txtPassword.Text = ; txtId.Text = ; 主窗口程序AdminWindou.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using Syste

16、m.Linq;using System.Text;using System.Windows.Forms;namespace 学生成绩管理系统 public partial class AdminWindow : Form public AdminWindow() InitializeComponent(); private void AdminWindow_Load(object sender, EventArgs e) private void 查询学生信息ToolStripMenuItem2_Click(object sender, EventArgs e) new SearchStude

17、nt().ShowDialog(); private void 添加学生信息ToolStripMenuItem3_Click(object sender, EventArgs e) new AddStudent().ShowDialog(); private void 修改学生信息ToolStripMenuItem3_Click(object sender, EventArgs e) new UpdateStudent().ShowDialog(); private void 删除学生信息ToolStripMenuItem3_Click(object sender, EventArgs e)

18、new DeleteStudent().ShowDialog(); private void 查询课程信息ToolStripMenuItem2_Click(object sender, EventArgs e) new SearchCourse().ShowDialog(); private void 添加课程信息ToolStripMenuItem3_Click(object sender, EventArgs e) new AddCourse().ShowDialog(); private void 修改学生信息ToolStripMenuItem3_Click(object sender,

19、EventArgs e) new UpdateCourse().ShowDialog(); private void 删除课程信息ToolStripMenuItem3_Click(object sender, EventArgs e) new DeleteCourse().ShowDialog(); private void 关于ToolStripMenuItem2_Click(object sender, EventArgs e) new About().ShowDialog(); private void 退出系统ToolStripMenuItem2_Click(object sender

20、, EventArgs e) Application.Exit(); private void 排名ToolStripMenuItem1_Click(object sender, EventArgs e) new CourseRank().ShowDialog(); private void 查询学生成绩ToolStripMenuItem2_Click(object sender, EventArgs e) new ScoreSearch().ShowDialog(); private void 各班平均分ToolStripMenuItem2_Click(object sender, Even

21、tArgs e) new ClassAvg().ShowDialog(); private void 各科平均分ToolStripMenuItem2_Click(object sender, EventArgs e) new CourseAvg().ShowDialog(); 班级平均成绩查询ClassAvg.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using Syste

22、m.Text;using System.Windows.Forms;using MySql.Data.MySqlClient;namespace 学生成绩管理系统 public partial class ClassAvg : Form public ClassAvg() InitializeComponent(); private void ClassAvg_Load(object sender, EventArgs e) private void btnsearch_Click(object sender, EventArgs e) string bjmc = txtbjmc.Text;

23、using (MySqlConnection conn = new MySqlConnection(Database=student;Data Source=localhost;User Id=root;Password=k6smile20xq) conn.Open(); using (MySqlCommand cmd = conn.CreateCommand() cmd.CommandText = select avg(score) from scoreinfi where classname=bjmc; cmd.Parameters.Add(new MySqlParameter(bjmc,

24、bjmc); string bjavg=Convert.ToString(cmd.ExecuteScalar(); txtbjavg.Text = bjavg; private void btncancle_Click(object sender, EventArgs e) this.Close(); 单科平均成绩CourseAvg.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq

25、;using System.Text;using System.Windows.Forms;using MySql.Data.MySqlClient;namespace 学生成绩管理系统 public partial class CourseAvg : Form public CourseAvg() InitializeComponent(); private void btnquery_Click(object sender, EventArgs e) string courseid = txtcourseid.Text; string coursename = txtcoursename.

26、Text; using (MySqlConnection conn = new MySqlConnection(Database=student;Data Source=localhost;User Id=root;Password=k6smile20xq) conn.Open(); using (MySqlCommand cmd = conn.CreateCommand() cmd.CommandText = select avg(score) as avg from scoreinfi where cname=coursename; cmd.Parameters.Add(new MySql

27、Parameter(coursename,coursename); /* DataSet dataset = new DataSet(); MySqlDataAdapter adapter = new MySqlDataAdapter(cmd); adapter.Fill(dataset); DataTable table = dataset.Tables0; for(int i=0;itable.Rows.Count;i+) DataRow row=table.Rowsi; txtavg.Text=Convert.ToString(rowavg); */ txtavg.Text=Conver

28、t.ToString(cmd.ExecuteScalar(); private void CourseAvg_Load(object sender, EventArgs e) private void btnexit_Click(object sender, EventArgs e) this.Close(); 单科成绩排名CourseRank.csusing 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 MySql.Data.MySqlClient;namespace 学生成绩管理系统 public partial class CourseRank : Form public CourseRank() InitializeComponent(); private void Form1_Load(object sender, EventArgs e) / this

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2