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

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

ID:35351746

大小:82.33 KB

页数:32页

时间:2019-03-23

学生成绩管理系统课程设计源程序_第1页
学生成绩管理系统课程设计源程序_第2页
学生成绩管理系统课程设计源程序_第3页
学生成绩管理系统课程设计源程序_第4页
学生成绩管理系统课程设计源程序_第5页
资源描述:

《学生成绩管理系统课程设计源程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、关于About.csusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Reflection;namespace学生成绩管理系统{publicpartialclassAbout:Form{publicAbout(){Initia

2、lizeComponent();privatevoidbuttonl_C1ick(objectsender,EvenlArgse){this.Close();}privatevoidAbout_Load(objectsender,EventArgse)}}添加课程信息AddCourse.csusingSystem;usingSystem.Colledions.Generic;usingSystem.ComponentModel;usingSystem・Dst3;usingSystem.Drawing;usingSystem.Lin

3、q;usingSystem.Text;usingSystem.Windows.Forms;usingMySql.Data.MySqlClient;namespace学生成绩管理系统publicpartialclassAddCourse:Form{publicAddCourse(){InitializeComponent();}privatevoidbtnExitClick(objectsender,EventArgse){this.Close();}privatevoidbtnAddCourseClick(objectsender

4、,EventArgse){stringmyConnectionString="Database二student;DataSource=localhost;UserId二root;Password二k6smile20xq〃;MySqlConnectionmycn二newMySqlConnection(myConnectionString);mycn・Open();stringsql;Coursecourse=newCourse();course.Cno二txtCno.Text;course.Cname=txtCname.Text;t

5、ry{sql="selectcount(*)fromcoursewherecno=,"+txtCno.Text+MySqlCommandmycm=newMySqlCommand(sql,mycn);MySq1DataReadermsdr=mycm・ExecuteReader();msdr.Read();intstuCount二msdr.Getlnt32("count(*)〃);msdr.CloseO;if(stuCount==0&&txtCname.Text!=&&txtCno.Text!="”){sql=〃insertintoc

6、ourse(eno,cname)valuesC,z+course.Cno++course.Cname+MySqlCommandmycml=newMySqlCommand(sql,mycn);trymycm1・ExecutcNonQuery();}catch(Except!onexception){MessageBox.Show(exception.Message);return;}final1y{mycn.Close();}MessageBox.ShowC添加成功!“);}elseif(stuCount>=1&&txtCno.Te

7、xt!=&&txtCname.Text!="“){//这里需要关闭资源MessageBox.Show(/Z该课程的信息己存在,请重新输入!");}else{//这里需要关闭资源MessageBox.Show(”请输入要添加的信息");msdr.CloseO;mycn.Close();})catch(Exceptiona){Console.WriteLine(a.ToStringO);}finally{txtCno.Text二"“;txtCname.Text二privatevoidAddCourse_Load(objectsende

8、r,EvontArgse)添加学半信息AddStudent.csusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usin

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。