号、课程号和成绩, 提供对选课成绩信息的录入、查询、修改和删除的操作。
⑤用户管理模块 用户管理模块用于用户账号和密码的管理,其功能包括添加用户,注销用户和修改密码。
2 数据库结构设计①数据库列表:表单号 表单名 功能U_STUDENTS 学生信息表 储存学生个人信息U_COURSES 课程信息表 储存每科课程的信息U_SCORES 选修成绩表 储存学生所选修的课程的成绩USERS 用户表 储存用户的账号与密码U_CLASSES 班级表 存储班级信息②数据库 E-R 图③数据库表单创建“USERS”并添加各字段,如图所示:创建“U_STUDENTS”并添加各字段,如图所示:创建“U_COURSES”并添加各字段,如图所示:创建“U_SCORES”并添加各字段,如图所示:创建“U_CLASSES”并添加各字段,如图所示:④主要查询功能的 SQL 语句:查询学生信息按学号查找select SNO 学号SNAME 姓名SSEX 性别SAGE 年龄U_STUDENTS.CID 班号MAJOR 专业CLASS 班级DEPARTMENT 系别 from dbo.U_STUDENTSdbo.U_CLASSES wheredbo.U_STUDENTS.CIDdbo.U_CLASSES.CID and SNOquot textBox6.Text quotquot按姓名查找select SNO 学号SNAME 姓名SSEX 性别SAGE 年龄U_STUDENTS.CID 班号MAJOR 专业CLASS 班级DEPARTMENT 系别 from dbo.U_STUDENTSdbo.U_CLASSES wheredbo.U_STUDENTS.CIDdbo.U_CLASSES.CID and SNAMEquot textBox7.Text quot添加学生记录 selectSQL quotselect SNO 学号SNAME 姓名SSEX 性别SAGE 年龄U_STUDENTS.CID 班号MAJOR 专业CLASS 班级DEPARTMENT 系别 from dbo.U_STUDENTSdbo.U_CLASSES wheredbo.U_STUDENTS.CIDdbo.U_CLASSES.CID and SNAMEquot textBox7.Text quotquot修改学生记录update dbo.U_STUDENTS setSNAMEquottextBox2.TextquotSSEXquottextBox3.TextquotSAGEquottextBox4.TextquotCIDquottextBox5.Textquotwhere SNOquottextBox1.Textquotquot删除学生记录delete from dbo.U_STUDENTS where SNOquottextBox1.Text quot查询课程信息 selectSQL quotselect CNO 课程号COURSE 课程名CREDIT 学分TEACHER 教师 fromdbo.U_COURSES where CNOquot textBox4.Text quotquot按课程号查询 select CNO 课程号COURSE 课程名CREDIT 学分TEACHER 教师 from dbo.U_COURSES whereCOURSEquot textBox5.Text quotquot(按课程名查询)删除课程信息delete from dbo.U_COURSES where CNOquot textBox1.Text quot修改课程记录quotupdate dbo.U_COURSES set COURSEquot textBox2.Text quotCREDITquot textBox3.Text quotTEACHERquot textBox6.Text quot where CNOquot textBox1.Text quotquot添加课程记录insert into dbo.U_COURSESCNOCOURSECREDITTEACHERvaluesquot textBox1.Text quotquot textBox2.Text quotquot textBox3.Text quotquot textBox6.Text quotquot查询选修课成绩select dbo.U_STUDENTS.SNO 学 号 dbo.U_STUDENTS.SNAME 姓 名 dbo.U_COURSES.CNO 课 程号 dbo.U_COURSES.COURSE 课 程 名 dbo.U_COURSES.TEACHER 教 师 dbo.U_SCORES.SCORE 成 绩fromdbo.U_STUDENTSdbo.U_COURSESdbo.U_SCORESwhere dbo.U_STUDENTS.SNOdbo.U_SCORES.SNO and dbo.U_COURSES.CNOdbo.U_SCORES.CNOquot3 开发方案的选择(主要是前端开发平台的选择与方案的比较) 前台开发方案主要有两种大方向:主要存在 B-S 模式和 C-S 模式,B-S 模式指的是浏览器服务器模式,C-S 模式指的是客户服务器模式。
B-S 模式可以选择 ASP、
JSP、PHP 等通过浏览器解析运行网页文件来实现相应功能。
C-S 模式可选前台开发语言较多,主要有:JAVA,C,C等,通过窗体来实现相应功能。
四、系统实施选课成绩模块(模块功能、运行界面、源代码)1.运行界面:2.源代码using Systemusing System.Collections.Genericusing System.ComponentModelusing System.Datausing System.Drawingusing System.Linqusing System.Textusing System.Windows.Formsusing System.Data.SqlClientnamespace Project2 public partial class Form5 : Form public Form5 InitializeComponent private void button1_Clickobject sender EventArgs e if textBox1.Text quotquot textBox3.Text quotquot MessageBox.Showquot必须填写学号和课程号!填完修改信息再按修改按钮!quot return string UpdateSQL quotupdate dbo.U_SCORES set SCOREquot textBox5.Text quot whereSNOquottextBox1.Textquot and CNOquottextBox3.Textquotquot ExcuteSQLUpdateSQL MessageBox.Showquot修改成功!quot private void button4_Clickobject sender EventArgs e Form2 form2 new Form2 this.Hide form2.Show private void button2_Clickobject sender EventArgs e if textBox1.Text quotquot ampamp textBox3.Text quotquot MessageBox.Showquot学号和课程号是必填项,请填完后再单击添加按钮!quot return string InsertSQL quotinsert intodbo.U_SCORESSNOCNOSCOREvaluesquottextBox1.TextquotquottextBox3.TextquotquottextBox5.Textquotquot ExcuteSQLInsertSQL MessageBox.Showquot添加成功!quot private void button3_Clickobject sender EventArgs e if textBox1.Text quotquot ampamp textBox3.Text quotquot MessageBox.Showquot必须填写学生学号和课程号,请填完后再单击删除按钮!quot return string DeleteSQL quotdelete from dbo.U_SCORES where SNOquottextBox1.Textquot andCNOquottextBox3.Textquotquot ExcuteSQLDeleteSQL MessageBox.Showquot删除成功!quot private void Display String ConnectionString quotData SourcelocalhostInitial CatalogstudentsPersist SecurityInfoTrueUser IDsaPasswordtxd100511726quot SqlConnection myCon new SqlConnectionConnectionString myCon.Open SqlCommand myCom new SqlCommand myCom.CommandType CommandType.Text string comstr quotselectU_STUDENTS.SNOU_STUDENTS.SNAMEU_COURSES.CNOU_COURSES.COURSEU_SCORES.SCORE from dbo.U_STUDENTSdbo.U_COURSESdbo.U_SCORES where U_STUDENTS.SNOU_SCORES.SNOand U_COURSES.CNOU_SCORES.CNOquot myCom.CommandText comstr myCom.Connection myCon SqlDataReader myReader myCom.ExecuteReader myReader.Read textBox1.Text myReader.GetString0 textBox2.Text myReader.GetString1 textBox3.Text myReader.GetInt162.ToString textBox4.Text myReader.GetString3 textBox5.Text myReader.GetInt324.ToString myReader.Close myCon.Close private void ExcuteSQLstring SQL String ConnectionString quotData SourcelocalhostInitial CatalogstudentsPersist SecurityInfoTrueUser IDsaPasswordtxd100511726quot SqlConnection myCon new SqlConnectionConnectionString myCon.Open SqlCommand myCom new SqlCommand myCom.CommandType CommandType.Text myCom.CommandText SQL myCom.Connection myCon myCom.ExecuteNonQuery myCon.Close private void textBox3_TextChangedobject sender EventArgs e private void Form5_Loadobject sender EventArgs e Display private void button6_Clickobject sender EventArgs e String ConnectionString quotData SourcelocalhostInitial CatalogstudentsPersist SecurityInfoTrueUser IDsaPasswordtxd100511726quot SqlConnection myCon new SqlConnectionConnectionString myCon.Open string selectSQL quotselect dbo.U_STUDENTS.SNO 学 号 dbo.U_STUDENTS.SNAME 姓名 dbo.U_COURSES.CNO 课 程 号 dbo.U_COURSES.COURSE 课 程 名 dbo.U_COURSES.TEACHER 教师 dbo.U_SCORES.SCORE 成 绩 from dbo.U_STUDENTSdbo.U_COURSESdbo.U_SCORES wheredbo.U_STUDENTS.SNOdbo.U_SCORES.SNO and dbo.U_COURSES.CNOdbo.U_SCORES.CNOquot SqlCommand myCom new SqlCommand SqlDataAdapter myadpt new SqlDataAdapterselectSQL myCon DataSet dataset new DataSet dataGridView1.DataSource dataset dataset.Clear myadpt.Filldataset dataGridView1.DataSource dataset.Tables0.DefaultView myCon.Close private void button5_Clickobject sender EventArgs e String ConnectionString quotData SourcelocalhostInitial CatalogstudentsPersist SecurityInfoTrueUser IDsaPasswordtxd100511726quot SqlConnection myCon new SqlConnectionConnectionString myCon.Open if textBox6.Text quotquottextBox7.Text quotquot MessageBox.Showquot学生学号和课程名都不能为空,请填完后再单击查找按钮!quot return else string selectSQL quotselect dbo.U_STUDENTS.SNO 学号dbo.U_STUDENTS.SNAME 姓名 dbo.U_COURSES.CNO 课 程 号 dbo.U_COURSES.COURSE 课 程 名 dbo.U_COURSES.TEACHER 教师 dbo.U_SCORES.SCORE 成 绩 from dbo.U_STUDENTSdbo.U_COURSESdbo.U_SCORES wheredbo.U_STUDENTS.SNOdbo.U_SCORES.SNO and dbo.U_COURSES.CNOdbo.U_SCORES.CNO anddbo.U_STUDENTS.SNOquot textBox6.Text quot and dbo.U_COURSES.COURSEquot textBox7.Text quotquot SqlCommand myCom new SqlCommand SqlDataAdapter myadpt new SqlDataAdapterselectSQL myCon DataSet dataset new DataSet dataGridView1.DataSource dataset dataset.Clear myadpt.Filldataset dataGridView1.DataSource dataset.Tables0.DefaultView myCon.Close private void textBox6_TextChangedobject sender EventArgs e private void button7_Clickobject sender EventArgs e String ConnectionString quotData SourcelocalhostInitial CatalogstudentsPersist SecurityInfoTrueUser IDsaPasswordtxd100511726quot SqlConnection myCon new SqlConnectionConnectionString myCon.Open if textBox6.Text quotquot MessageBox.Showquot学生学号不能为空,请填完后再单击查找按钮!quot return else .
上一篇:
计算机毕业设计列表课题共同学们参考
下一篇:
法律专业开题报告范文