學(xué)生成績(jī)管理系統(tǒng)設(shè)計(jì)報(bào)告28171_第1頁(yè)
學(xué)生成績(jī)管理系統(tǒng)設(shè)計(jì)報(bào)告28171_第2頁(yè)
學(xué)生成績(jī)管理系統(tǒng)設(shè)計(jì)報(bào)告28171_第3頁(yè)
已閱讀5頁(yè),還剩48頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、學(xué)生成績(jī)管理系統(tǒng)設(shè)計(jì)報(bào)告專 業(yè): 計(jì)算機(jī)信息管理學(xué) 號(hào): 102001205姓 名:和坤指導(dǎo)老師:薛海燕2011年11月22日第1章緒論1.1開發(fā)背景隨著社會(huì)信息量的與日劇增,學(xué)校需要有一很好的學(xué)生成績(jī)管 理系統(tǒng),以方便對(duì)學(xué)生的成績(jī)進(jìn)行有效的管理。系統(tǒng)應(yīng)具有既方便教師對(duì)學(xué)生成績(jī)的查詢和插入,也方便學(xué)生對(duì)自己成績(jī)和獲得的學(xué)分進(jìn) 行查詢的功能。而我國(guó)大中專院校的學(xué)生成績(jī)管理水平普遍不高。在當(dāng)今的信 息時(shí)代,傳統(tǒng)的管理方法必然要被以計(jì)算機(jī)為基礎(chǔ)的信息管理系統(tǒng)所 替代,而且目前很多重點(diǎn)院校都已經(jīng)有了自己的教務(wù)管理系統(tǒng)。已有的學(xué)生管理系統(tǒng)大都偏向?qū)W生檔案管理、學(xué)籍管理等。本案例設(shè)計(jì)的“學(xué)生成績(jī)管理系統(tǒng)”

2、以學(xué)生成績(jī)數(shù)據(jù)為主的管理,具有數(shù)據(jù)操作方便、高效、迅速等優(yōu)點(diǎn)。1.2系統(tǒng)開發(fā)工具選擇本系統(tǒng)采用.NET Frameworkl.架構(gòu)為公司內(nèi)部使用,按照商業(yè)軟 件模式設(shè)計(jì),使用微軟公司的Visual Studio2008為前端開發(fā)工具,微 軟公司的SQLServer200為后臺(tái)數(shù)據(jù)庫(kù),使用Click One來(lái)制作安裝程 序。Visual Studio2008是一種可視化的、面對(duì)對(duì)象和條用事件驅(qū)動(dòng)方 式的winform前端開發(fā)工具,可用于開發(fā) Windows環(huán)境下的應(yīng)用程序。 通過(guò)降低其復(fù)雜度從而使 Win dows軟件開發(fā)得以廣泛應(yīng)用。最近, 利用Visual Studio .NET Micro

3、soft又為開發(fā)人員提供了輕松開發(fā) 分 布式應(yīng)用程序的工具與技術(shù)。SQLServer200是新一代大型關(guān)系數(shù)據(jù) 管理系統(tǒng),它在電子商務(wù)、數(shù)據(jù)倉(cāng)庫(kù)和數(shù)據(jù)庫(kù)解決方案等應(yīng)用中起著 重要的核心作用,可為企業(yè)的數(shù)據(jù)管理提供強(qiáng)大的支持, 對(duì)數(shù)據(jù)庫(kù)中 的數(shù)據(jù)提供有效的管理,并采用有效的措施實(shí)現(xiàn)數(shù)據(jù)的完整性及數(shù)據(jù) 的安全性。第2章系統(tǒng)分析與數(shù)據(jù)庫(kù)設(shè)計(jì)2.1系統(tǒng)功能需求1)待開發(fā)軟件的功能需求學(xué)生成績(jī)管理系統(tǒng)必須能夠完成系統(tǒng)管理、成績(jī)管理、課程管理、 班級(jí)管理、學(xué)生基本信息管理、專業(yè)管理、教師管理、課程表管理。 系統(tǒng)管理員可實(shí)現(xiàn)所有功能。管理員無(wú)法實(shí)現(xiàn)數(shù)據(jù)庫(kù)的備份和還原功 能,其他功能都可以實(shí)現(xiàn)。(1)系統(tǒng)管理

4、主要是維護(hù)系統(tǒng)的正常運(yùn)行和安全性設(shè)置,當(dāng)?shù)卿浻脩羰枪芾韱T或系統(tǒng)管理員時(shí)能完成查詢用戶、添加用戶、刪除 用戶、修改密碼、重新登錄等功能。當(dāng)?shù)卿浬矸菔墙處熀蛯W(xué)生 時(shí)只能實(shí)現(xiàn)重新登錄和密碼修改。(2)成績(jī)管理主要是學(xué)生成績(jī)的查詢、錄入、修改、刪除及統(tǒng)計(jì)個(gè) 人成績(jī)的功能。用戶登錄身份是教師時(shí)可實(shí)現(xiàn)成績(jī)的錄入和查 詢。登錄身份是學(xué)生時(shí)只能實(shí)現(xiàn)成績(jī)查詢和個(gè)人成績(jī)統(tǒng)計(jì)功能。(3)課程管理主要是課程信息的查詢和操作(添加、修改、刪除)用戶登錄身份是教師和學(xué)生時(shí)只能進(jìn)行查詢操作。(4)班級(jí)管理主要是班級(jí)信息的查詢和操作(添加、修改、刪除)用戶登錄身份是教師和學(xué)生時(shí)只能進(jìn)行查詢操作。(5)學(xué)生管理主要是學(xué)生信息的

5、查詢和操作(添加、修改、刪除) 用戶登錄身份是教師和學(xué)生時(shí)只能進(jìn)行查詢操作。(6)專業(yè)管理主要是專業(yè)信息的查詢和操作(添加、修改、刪除)用戶登錄身份是教師和學(xué)生時(shí)只能進(jìn)行查詢操作。(7)教師管理主要是教師信息的查詢和操作(添加、修改、刪除) 用戶登錄身份是教師只能進(jìn)行查詢操作。(8)課程表管理主要是班級(jí)信息的查詢和操作 (添加、修改、刪除) 用戶登錄身份是教師和學(xué)生時(shí)只能進(jìn)行查詢操作。(9)窗體:窗體層疊,水平平鋪,垂直平鋪。打開多個(gè)窗體時(shí)后, 在點(diǎn)擊這個(gè)功能。(10)退出:結(jié)束操作系統(tǒng)。2.2數(shù)據(jù)描述表2.2-1用戶登錄表(Userlnfo)字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Useri

6、d用戶名Varchar10否是Userpwd用戶密碼Varchar10否否Userlevel用戶權(quán)限Varchar10是否表 2.2-2 專業(yè)信息表(Specialtylnfo)字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Specialtyid專業(yè)代號(hào)Varchar4否是Specialt yn ame專業(yè)名稱Varchar50是否表2.2-3班級(jí)信息表(ClassInfo)字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Classid班級(jí)名稱Varchar10否是Specialtyid專業(yè)代號(hào)Varchar4是否Stunum學(xué)生人數(shù)int是否Remark備注Varchar100是否表2.2-4教師信息表(

7、Teacherlnfo)字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Teaid教師編號(hào)Varchar10否是Teaname教師姓名Varchar20是否Teasex教師性別Varchar2是否Teaoffice辦公室電話Varchar11是否Teatel私人電話Varchar11是否Taddress家庭住址Varchar100是否Teabirthday出生年月Datetime是否表2.2-5學(xué)生信息表(Studentlnfo)字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Sno學(xué)號(hào)Varchar10否是Sn ame姓名Varchar20是否Sex性別Varchar2是否Sbirthday出生年月Date

8、time是否Classid所在班級(jí)Varchar10是否Specialtyid所在專業(yè)號(hào)Varchar4是否Stel電話Varchar11是否Saddress家庭住址Varchar100是否表2.2-6成績(jī)信息表(StuGrade字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Sno學(xué)號(hào)Varchar10否是Cno課程編號(hào)Varchar10否是Gradepeacetime平時(shí)成績(jī)nu meric4,1否否GradeWrite筆試成績(jī)nu meric4,1否否Grade總成績(jī)nu meric4,1否否Time時(shí)間Varchar30否否表2.2-7課程信息表(Courselnfo)字段名中文描述類型長(zhǎng)度是

9、否為空是否為主鍵Cno課程編號(hào)Varchar10否是Cn ame課程名稱Varchar50是否Cprime nt實(shí)驗(yàn)學(xué)時(shí)int是否Cteach ing講課學(xué)時(shí)int是否Credit總學(xué)分nu meric4,1是否Coursetypeid課程類型號(hào)int是否表2.2-8課程類型表(CourseType字段名中文描述類型長(zhǎng)度是否為空是否為主鍵Coursetypeid課程類型編號(hào)int否是Coursetype name課程類型名Varchar20否否表 2.2-9 課程表(CourseTabie字段名中文描述類型長(zhǎng)度是否為空是否為主鍵ID標(biāo)識(shí)列int否是Time學(xué)年Varchar30否否Termid

10、學(xué)期int否否Classid班級(jí)名稱Varchar10否否Cno課程編號(hào)Varchar10是否Teaid教師編號(hào)Varchar10是否主界面程序源代碼private void button1_Click( object sender, EventArgs e) / 登錄DBHelp DBhelp = new DBHelp();SqlConnection con = new SqlConnection (DBhelp.constr);string sql =""if (radioButton1.Checked = true )sql= string .Format( &quo

11、t;select * from UserInfo where Userid='0' and Userpwd='1'and Userlevel='2'" , textBox1.Text, textBox2.Text, radioButton1.Text);Program.x ="管理員"if (radioButton2.Checked = true )sql= string .Format( "select * from UserInfo where Userid='0' and Userpw

12、d='1'and Userlevel='2'" , textBox1.Text, textBox2.Text, radioButton2.Text);Program.x ="教師"if (radioButton3.Checked = true )sql= string .Format( "select * from UserInfo where Userid='0' and Userpwd='1'and Userlevel='2'" , textBox1.Text,

13、 textBox2.Text, radioButton3.Text);Program.x ="學(xué)生"if (radioButton4.Checked = true )and Userpwd='1'sql= string .Format( "select * from Userinfo where Userid='0'and Userlevel='2'" , textBoxl.Text, textBox2.Text, radioButton4.Text);con.Open();SqlCommancCom =

14、new SqlCommandsql, con);SqlDataReader red = com.ExecuteReader();if (red.Read()Form_main fl = new Form_main();f1.Show();elseMessageBoxShow(”信息錯(cuò)誤","error");Form_main fl = new Form_main();f1.Show();private void button2_Click( object sender, EventArgs e) / 取丫肖Application .Exit();private v

15、oid Form_main_Load( object sender, EventArgs e)if ( Program .x ="管理員")數(shù)據(jù)庫(kù)備份 ToolStripMenultem.Enabled =false數(shù)據(jù)庫(kù)恢復(fù) ToolStripMenultem.Enabled =falseif ( Program .x ="教師")用戶管理 ToolStripMenultem.Enabled =false ;數(shù)據(jù)庫(kù)備份ToolStripMenuItem.Enabled =false;數(shù)據(jù)庫(kù)恢復(fù)ToolStripMenuItem.Enabled =fal

16、se;成績(jī)修改 ToolStripMenuItem.Enabled =false ;課程信息操作ToolStripMenuItem.Enabled=false班級(jí)信息操作ToolStripMenuItem.Enabled=false學(xué)生信息操做ToolStripMenuItem.Enabled=false教師信息操作ToolStripMenuItem.Enabled=false課程表操作ToolStripMenuItem.Enabled =false;專業(yè)信息操作ToolStripMenuItem.Enabled=falseif ( Program .x ="學(xué)生")用戶管

17、理 ToolStripMenuItem.Enabled =false ;數(shù)據(jù)庫(kù)備份 ToolStripMenuItem.Enabled =false ;數(shù)據(jù)庫(kù)恢復(fù) ToolStripMenuItem.Enabled =false ;成績(jī)修改 ToolStripMenuItem.Enabled =false ;課程信息操作 ToolStripMenuItem.Enabled =false班級(jí)信息操作 ToolStripMenuItem.Enabled =false學(xué)生信息操做 ToolStripMenultem.Enabled = false 課程表操作 ToolStripMenultem.En

18、abled = false ; 成績(jī)錄入 ToolStripMenultem.Enabled =false ;教師管理 ToolStripMenultem.Enabled =false ;專業(yè)信息操作 ToolStripMenultem.Enabled = false private void 退出 ToolStripMenultem_Click( object sender, EventArgs e)Application .Exit();private void 用戶查詢 ToolStripMenuItem_Click(objectsender,EventArgse)Form_usesel

19、 usesel= new Form_usesel ();usesel.MdiParent =this ;usesel.Show();private void 用戶操作 ToolStripMenuItem_Click(objectsender,EventArgse)Form_use use = new Form_use();use.MdiParent =this ;use.Show();private void成績(jī)錄入 ToolStripMenuItem_Click(objectsender,EventArgse)Form_scoreinto f4 = new Form_scoreinto ()

20、;f4.Show();private void 成績(jī)修改 ToolStripMenuItem_Click(objectsender,EventArgse)Form_Score f5 = new Form_Score();f5.Show();private void 成績(jī)查詢 ToolStripMenultem1_Click(object sender,EventArgs e)Form_scoresel f6 = new Form_scoresel ();f6.Show();object sender,EventArgs e)object sender,EventArgs e)private v

21、oid 密碼修改 ToolStripMenultem_Click( Form_pwdpwd = new Form_pwQ);pwd.MdiParent =this ;pwd.Show();private void 重新登錄 ToolStripMenultem_Click(Login f1 = new Login (); this .Close();f1.Show();private void 數(shù)據(jù)庫(kù)備份 ToolStripMenultem_Click( object sender, EventArgs e) string path ="G:102001205 何坤 DB 備份 stu

22、dent.bak"string backupstr = "backup database Student to disk='"+path+"'"DBHelp DBHelp=new DBHelp ();SqlConnection con= new SqlConnection (DBHelp.constr);SqlCommanctom= new SqlCommanc(backupstr,con);trycon.Open();com.ExecuteNonQuery();MessageBoxShow(”備份成功”);catchMessa

23、geBoxShow(”備份失敗”);finallyEventArgs e)+ path +EventArgs e)EventArgs e)private void 垂直平鋪 ToolStripMenultem_Click(object sender,EventArgs e)this 丄ayoutMdi( MdiLayout .TileVertical); con.Close();private void 數(shù)據(jù)庫(kù)恢復(fù) ToolStripMenultem_Click( object sender, string path = "G:102001205 何坤 DB 備份 student.b

24、ak"string restorestr = "restore database Student to disk='" DBHelp DBHelp = new DBHelp();SqlConnection con = new SqlConnection (DBHelp.constr); SqlCommanctom = new SqlComman(testorestr, con);trycon.Open();com.ExecuteNonQuery();MessageBoxShow(”恢復(fù)成功”);catchMessageBoxShow(”恢復(fù)失敗”);fin

25、allycon.Close();private void 窗體層疊 ToolStripMenultem_Click( object sender, this 丄ayoutMdi( MdiLayout .Cascade);private void 水平平鋪 ToolStripMenultem_Click( object sender, this 丄ayoutMdi( MdiLayout .TileHorizontal);private void 教師信息查詢 ToolStripMenultem_Click( Teachersel teasel= new Teachersel ();teasel.

26、MdiParent =this ;object sender,EventArgs e)teasel.Show();private void 教師信息操作 ToolStripMenuItem_Click( object sender, Teacher tea = new Teacher ();tea.MdiParent =this ;tea.Show();EventArgs e)private void 學(xué)生信息查詢 ToolStripMenultem_Click(object sender,EventArgs e)Stusel stusel = new Stusel (); stusel.Md

27、iParent =this ;stusel.Show();private void 學(xué)生信息操做 ToolStripMenultem_Click( object sender, Student stu = new Student ();stu.MdiParent =this ;stu.Show();EventArgs e)privatevoid統(tǒng)計(jì)個(gè)人成績(jī)ToolStripMenultem_Click(object sender,EventArgs e)tongji t = new tongji ();t.MdiParent =thist.Show();EventArgs e)private

28、void 專業(yè)信息查詢 ToolStripMenultem_Click( object sender, Specialty_sel s = new Specialty_sel ();s.MdiParent=this ;s.Show();Coursetablesel table = new Coursetablesel ();table.MdiParent =this ;table.Show();private void 課程表操作 ToolStripMenultem_Click( object sender, EventArgs e) Coursetable ta = new Courseta

29、ble ();ta.MdiParent =this ;ta.Show();private void 課程管理 ToolStripMenultem1_Click( object sender, EventArgs e)Form_Coursesel f= new Form_Coursesel ();f.MdiParent =this ;f.Show();private void 課程信息操作 ToolStripMenultem_Click( object sender, EventArgs e) Form_Course C = new Form_Course();C.MdiParent =this

30、 ;C.Show();private void 班級(jí)查詢 ToolStripMenultem_Click( object sender, EventArgs e)Classsel s = new Classsel ();s.MdiParent =this ;s.Show();private void 班級(jí)信息操作 ToolStripMenultem_Click( object sender, EventArgs e) Class c = new Class ();c.MdiParent =this ;c.Show();Specialty sa = new Specialty ();sa.Mdi

31、Parent=this ;sa.Show();Class.csprivatevoid Class_Load( object sender, EventArgs e) tryDBHelp DBhelp = new DBHelp();SqlConnection con = new SqlConnection (DBhelp.constr); string sql = "select Specialtyname from SpecialtyInfo" SqlDataAdapter sda = new SqlDataAdapter (sql, con); DataSet ds =

32、new DataSet ();"a");sda.Fill(ds,foreach ( DataRow aRow in ds.Tables0.Rows)comboBox1.ltems.Add(aRow0.ToString().Trim();comboBox2.ltems.Add(aRow0.ToString().Trim();con.Close();catch ( Exception ex)MessageBoxShow(” 出錯(cuò)了!" + ex.ToString();private void button1_Click( object sender, EventArg

33、s e)tryDBHelp DBHelp = new DBHelp();SqlConnection con = new SqlConnection (DBHelp.constr);con.Open();string sql = "select Classid as 班級(jí),Specialtyname as 專業(yè)名,Stunum as 人 數(shù)Remark as 備注 from Classlnfo,Specialtylnfo where Classlnfo.Specialtyid=Specialtylnfo.Specialtyid"if (comboBoxl.Text !=&qu

34、ot;")sql +=" and Specialtyname='0'" ;if (textBoxl.Text !="”)sql +=" and Classid='1'" ;sql =string .Format(sql, comboBoxl.Text, textBoxl.Text);SqlDataAdapter sda = new SqlDataAdapter (sql, con);DataSet ds = new DataSet ();sda.Fill(ds,"a");dataGr

35、idViewl.DataSource = ds.Tables0;con.Close();Height =Convert .Tolnt32( "400");catch ( Exception ex)MessageBoxShow(” 出錯(cuò)了!" + ex.ToString();DBHelp DBHelp = new DBHelp();SqlConnection con = new SqlConnection (DBHelp.constr);con.Open();string sql = "select Classid as 班級(jí),Specialtyname

36、as 專業(yè)名,Stunum as 人數(shù) Remark as 備注 from Classlnfo,Specialtylnfo where Classlnfo.Specialtyid=Specialtylnfo.Specialtyid"SqlDataAdapter sda = new SqlDataAdapter (sql, con); DataSet ds = new DataSet ();sda.Fill(ds,"a");dataGridViewl.DataSource = ds.TablesO;con.Close();string a =""

37、private void button2_Click( object sender, EventArgs e) / 添加前清空 a ="add"true ;III!.textBox2.Enabled =comboBoxl.Text =III!.textBox2.Text =III!.textBox3.Text =III!.textBox4.Text =private void button3_Click(a ="update"object sender, EventArgs e) / 修改textBox2.Enabled =falseobject sen

38、der,EventArgs e)private void button4_Click(tryif (a = "add" )/ 添加保存DBHelp DBhelp = new DBHelp();SqlConnection con = new SqlConnection (DBhelp.constr);string sqll = string .Format( "select Specialtyid from Specialtyinfo whereSpecialtyname='0'",comboBox2.Text);SqlCommanctom

39、 = new SqlComman(feql1, con);con.Open();SqlDataReader dr = com.ExecuteReader(); string no =""if (dr.Read()no = dr0.ToString();con.Close();/string sql2 = string.Format("select Teaid from Teacherinfo where Teaname='0"', textBox2.Text);/SqlCommand com0 = new SqlCommand(sql2,

40、 con);con.Open();/SqlDataReader dr1 = com0.ExecuteReader();/string Tno =""/if (dr1.Read()/ Tno = dr10.ToString();/con.Close();string sql = string .Format( "insert into Classinfovalues('0','1','2','3')", textBox2.Text, no, textBox3.Text, textBox4.Te

41、xt);SqlCommanctoml = new SqlCommandsql, con);con.Open();int result = com1.ExecuteNonQuery();if (result > 0)MessageBoxShow("插入成功”);Datashow();elseMessageBoxShow("插入失敗");con.Close();if (a = "update" )/ 修改保存DBHelp DBhelp = new DBHelp();SqlConnection con = new SqlConnection (

42、DBhelp.constr);string sqll = string .Format( "select Specialtyid from Specialtyinfo where Specialtyname='0'" , comboBox2.Text);SqlCommanctom = new SqlCommandsqll, con);con.Open();SqlDataReader dr = com.ExecuteReader();string no =""if (dr.Read()no = dr0.ToString();con.Clos

43、e();string sql = string .Format( "update Classinfo setSpecialtyid='0',Stunum=1,Remark='2' where Classid='3"', no, textBox3.Text,textBox4.Text, textBox2.Text);SqlCommancComl = new SqlCommandsql, con);con.Open();int result = com1.ExecuteNonQuery();if (result > 0)Me

44、ssageBoxShow("修改成功”);Datashow();elseMessageBoxShow("修改失敗”);con.Close();catch ( Exception ex)MessageBoxShow(” 出錯(cuò)了!" + ex.ToString();private void button5_Click( object sender, EventArgs e) / 刪除tryif ( MessageBoxShow("確定要?jiǎng)h除",”提示信息",MessageBoxButtons .YesNo)=DialogResult .Y

45、es)DBHelp DBhelp = new DBHelp();SqlConnection con = new SqlConnection (DBhelp.constr);string sql = string .Format( "delete from Classinfo where Classid='0'" textBox2.Text);SqlCommanctom = new SqlComman(feql, con);con.Open();int result = com.ExecuteNonQuery();if (result > 0)Messa

46、geBoxShow("刪除成功”);Datashow();elseMessageBoxShow("刪除失敗”);con.Close();catch ( Exception ex)MessageBoxShow(” 出錯(cuò)了! " + ex.ToString();private void dataGridView1_CellClick( object sender, DataGridViewCellEventArgs e)textBox2.Text = dataGridView1.CurrentRow.Cells0.Value.ToString(); comboBox2

47、.Text = dataGridView1.CurrentRow.Cells1.Value.ToString(); textBox3.Text = dataGridView1.CurrentRow.Cells2.Value.ToString();textBox4.Text = dataGridView1.CurrentRow.Cells3.Value.ToString();G:102001205和坤學(xué)生成績(jī)管理系統(tǒng)學(xué)生成績(jī)管理系統(tǒng)Classsel.csprivate void Classsel_Load( object sender, EventArgs e)DBHelp DBhelp = n

48、ew DBHelp();SqlConnection con = new SqlConnection (DBhelp.constr); string sql = "select Specialtyname from Specialtyinfo" SqlDataAdapter sda = new SqlDataAdapter (sql, con); DataSet ds = new DataSet ();sda.Fill(ds,"a");foreach ( DataRow aRow in ds.TablesO.Rows)comboBox1.ltems.Add

49、(aRow0.ToString().Trim();con.Close();private void button1_Click( object sender, EventArgs e)tryDBHelp DBHelp = new DBHelp();SqlConnection con = new SqlConnection (DBHelp.constr);con.Open();string sql = "select Classid as 班級(jí),Specialtyname as 專業(yè)名,Stunum as 人 數(shù),Remark as 備注 from Classinfo,Specialt

50、yinfo where Classlnfo.Specialtyid=Specialtylnfo.Specialtyid"if (comboBoxl.Text !="")if (textBoxl.Text !="”)sql +=" and Classid='1”'sql =string .Format(sql, comboBoxl.Text, textBoxl.Text);SqlDataAdapter sda = new SqlDataAdapter (sql, con); DataSet ds = new DataSet ();

51、sda.Fill(ds,"a");dataGridView1.DataSource = ds.TablesO;con.Close();catch ( Exception ex)MessageBoxShow(” 出錯(cuò)了!" + ex.ToString();G:102001205和坤 學(xué)生成績(jī)管理系統(tǒng) 學(xué)生成績(jī)管理系統(tǒng)Coursetable.cs學(xué)年1學(xué)期V教那課程V班級(jí)labels匾課程春操作-學(xué)年學(xué)期VV教師課程7查詢漆加修改保存tryDBHelp DBHelp = new DBHelp();SqlConnection con = new SqlConnectio

52、n (DBHelp.constr);con.Open();string sql = "select ID,Time,Termid,Classid,Cname,Teaname from Coursetable,Courselnfo,Teacherlnfo where Coursetable.Cno=Courselnfo.Cno and Coursetable.Teaid=Teacherlnfo.Teaid" ;if (comboBox1.Text !="")sql +=" and Time='0"'if (comboBo

53、x2.Text !="")sql +=" and Termid=1"if (comboBox3.Text !="")sql +=" and Classid='2'" ;if (comboBox5.Text !="")sql +=" and Cname='3'"if (textBox1.Text !="”)sql +=" and Teaname='4'" ;sql =string .Format(sq

54、l, comboBox1.Text, comboBox2.Text, comboBox3.Text,comboBox5.Text, textBox1.Text);SqlDataAdapter sda = new SqlDataAdapter (sql, con);DataSet ds = new DataSet ();sda.Fill(ds,"a");dataGridView1.DataSource = ds.Tables0;con.Close();/列名顯示為中文dataGridView1.Columns0.HeaderText ="編號(hào)";dataG

55、ridView1.Columns1.HeaderText ="學(xué)年"dataGridView1.Columns2.HeaderText ="學(xué)期";dataGridView1.Columns3.HeaderText ="班級(jí)";dataGridView1.Columns4.HeaderText ="課程名稱"dataGridView1.Columns5.HeaderText ="教師姓名"catch ( Exception ex)MessageBoxShow(” 出錯(cuò)了!" + ex.ToString();private void dataGridView1_CellClick( object sender, DataGridViewCellEventA

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論