




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、本科學(xué)生設(shè)計(jì)性實(shí)驗(yàn)報(bào)告項(xiàng)目組長(zhǎng) 張茜夢(mèng) 學(xué)號(hào) 0063603 成 員 張茜夢(mèng) 俞伯龍 陳健 熊維娜 專 業(yè) 軟件工程 班級(jí) 06軟件1班 實(shí)驗(yàn)項(xiàng)目名稱 學(xué)籍管理系統(tǒng) 指導(dǎo)教師及職稱萬本庭 博士 開課學(xué)期 2008 至2009 學(xué)年 一學(xué)期上課時(shí)間 2008 年 11 月 17 日一、實(shí)驗(yàn)設(shè)計(jì)方案實(shí)驗(yàn)名稱:學(xué)籍管理系統(tǒng)實(shí)驗(yàn)時(shí)間:2008.11.17小組合作: 是 否小組成員:張茜夢(mèng) 俞伯龍 陳健 熊維娜 1、 實(shí)驗(yàn)?zāi)康模壕帉懸粋€(gè)學(xué)籍管理系統(tǒng),實(shí)現(xiàn)學(xué)生基本信息的管理。2、 實(shí)驗(yàn)場(chǎng)地及儀器、設(shè)備和材料:實(shí)驗(yàn)地點(diǎn):s203儀器、設(shè)備:電腦, C#語言編程環(huán)境(vs2005)3、 實(shí)驗(yàn)思路(實(shí)驗(yàn)內(nèi)容、數(shù)
2、據(jù)處理方法及實(shí)驗(yàn)步驟等):本次實(shí)驗(yàn)是實(shí)現(xiàn)一個(gè)學(xué)生學(xué)籍管理系統(tǒng),系統(tǒng)有基本的增,刪,查,改得功能。查詢功能主要是DataSet訪問數(shù)據(jù)的功能來查找到想要獲得的學(xué)生相關(guān)信息,查找完成后再運(yùn)用其刪除數(shù)據(jù)功能將查找結(jié)果刪除。界面上基本上是由gridview來顯示數(shù)據(jù)。通過添加數(shù)據(jù)源來和數(shù)據(jù)的Student表來連接,而后運(yùn)用該控件的自帶功能來完成編輯工作。指導(dǎo)老師對(duì)實(shí)驗(yàn)設(shè)計(jì)方案的意見: 該實(shí)驗(yàn)步驟正確、詳盡。程序設(shè)計(jì)合理,。實(shí)驗(yàn)總結(jié)全面、準(zhǔn)確,實(shí)驗(yàn)分析深刻。雖然可以完成任務(wù)但是都做到這個(gè)層次上來應(yīng)該加上POP3 接收信件,可以使改城功能更加強(qiáng)大,更能深入了解郵件的傳送協(xié)議的原理。 指導(dǎo)老師簽名:萬本庭
3、2008 年 12 月 29 日 二、實(shí)驗(yàn)結(jié)果與分析1、實(shí)驗(yàn)?zāi)康?、?chǎng)地及儀器、設(shè)備和材料、實(shí)驗(yàn)思路等見實(shí)驗(yàn)設(shè)計(jì)方案2、實(shí)驗(yàn)現(xiàn)象、數(shù)據(jù)及結(jié)果(1).打開sql2005,新建數(shù)據(jù)庫a,新建一個(gè)表“學(xué)籍”。(2). 新建一個(gè)Windows應(yīng)用程序, 建立表(3).給各個(gè)表添加相應(yīng)代碼如下: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms
4、;namespace WindowsApplication1 public partial class Form1 : Form public Form1() InitializeComponent(); private void buttonLogin_Click(object sender, EventArgs e) if (textBoxUser.Text.Trim() = | textBoxPassword.Text.Trim() = ) MessageBox.Show(Please input uesrname and password, 錯(cuò)誤提示); else if (textBo
5、xUser.Text.Trim() = admin | textBoxPassword.Text.Trim() = admin) Form3 f3 = new Form3(); f3.Show(); this.Hide(); else MessageBox.Show(Wrong user or password, 登錄失敗); private void buttonCancel_Click(object sender, EventArgs e) textBoxPassword.Text = ; textBoxUser.Text = ; private void Form1_Load(objec
6、t sender, EventArgs e) private void ButtonForm1Exit_Click(object sender, EventArgs e) this.Close(); #region Using Directivesusing System;using System.Data.SqlClient;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Wind
7、ows.Forms;#endregionnamespace WindowsApplication1 public partial class Form3 : Form public Form3() InitializeComponent(); private void exitToolStripMenuItem_Click(object sender, EventArgs e) this.Close(); private void aboutToolStripMenuItem_Click(object sender, EventArgs e) Form4 f4 = new Form4(); f
8、4.Show(); private void Form3_Load(object sender, EventArgs e) private void readToolStripMenuItem_Click(object sender, EventArgs e) string output; SqlConnection thisConnection = new SqlConnection(Server = (local)sqlexpress;Integrated Security=sspi; + Database =a); SqlDataAdapter thisAdapter = new Sql
9、DataAdapter(SELECT * from 學(xué)籍, thisConnection); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, 學(xué)生); this.textBox1.Text = StuNo + tt + StuName + tt + Address + tt + ID + tt+Phone+rn; foreach (DataRow therow in thisDataSet.Tables學(xué)生.Rows) output = therowStuNo + t + therowStuName + t
10、+ therowAddress + t + therowID+t+therowPhone + rn; this.textBox1.Text += output; thisConnection .Close (); Console .Write(program finished,press enter/return to continue:); Console .ReadLine (); private void addToolStripMenuItem_Click(object sender, EventArgs e) ADD add = new ADD(); add.Show(); priv
11、ate void deleteToolStripMenuItem_Click(object sender, EventArgs e) DELETE delete = new DELETE(); delete.Show(); private void searchToolStripMenuItem_Click(object sender, EventArgs e) SEARCH search = new SEARCH(); search.Show(); private void alterToolStripMenuItem_Click(object sender, EventArgs e) AL
12、TER alter = new ALTER(); alter.Show(); #region Using Directivesusing System;using System.Data.SqlClient;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;#endregionnamespace WindowsApplication1 public part
13、ial class ADD : Form public ADD() InitializeComponent(); private void buttonAddOK_Click(object sender, EventArgs e) string a, b, c, d,f; a = this.textBoxAddStuNo .Text; b = this.textBoxAddStuName .Text; c = this.textBoxAddAddress .Text; d = this.textBoxAddID .Text ; f = this.textBoxAddPhone.Text; if
14、 (textBoxAddStuNo.Text.Trim() = | textBoxAddStuName.Text.Trim() = | textBoxAddID.Text.Trim() = | textBoxAddAddress.Text.Trim() = | textBoxAddPhone.Text.Trim() = ) MessageBox.Show(please complete the information); else SqlConnection thisConnection = new SqlConnection(Server=00b758efb68a400;Integrated
15、 Security=sspi; + Database=a); SqlDataAdapter thisAdapter = new SqlDataAdapter(SELECT StuNo,StuName,Address,ID,Phone from 學(xué)籍, thisConnection); SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, 學(xué)籍); DataColumn keys =
16、 new DataColumn1; keys0 = thisDataSet.Tables學(xué)籍.ColumnsStuNo; thisDataSet.Tables學(xué)籍.PrimaryKey = keys; DataRow findRow = thisDataSet.Tables學(xué)籍.Rows.Find(a); if (findRow = null) DataRow thisRow = thisDataSet.Tables學(xué)籍.NewRow(); thisRowStuNo = a; thisRowStuName = b; thisRowAddress = c; thisRowId = d; this
17、Row Phone=f ; thisDataSet.Tables學(xué)籍.Rows.Add(thisRow); if (findRow = thisDataSet.Tables學(xué)籍.Rows.Find(a) != null) MessageBox .Show (Information added); /Form7 form7 = new Form7(); /form7.Show(); /output = 數(shù)據(jù)插入成功: + rn + StuNo: + this.textBox1.Text + rn + StuName: + /this.textBox2.Text + rn + Address: +
18、 this.textBox3.Text + rn + ID: + /this.textBox4.Text + rn+ID: + this.textBox4.Phone + rn; /textBox5.Text = output; else MessageBox .Show (該學(xué)號(hào)已有,請(qǐng)重新輸入); thisAdapter.Update(thisDataSet, 學(xué)籍); thisConnection.Close(); private void buttonAddExit_Click(object sender, EventArgs e) this.Close(); private void
19、 buttonAddClear_Click(object sender, EventArgs e) textBoxAddStuNo.Text = ; textBoxAddStuName.Text = ; textBoxAddID.Text = ; textBoxAddAddress.Text = ; textBoxAddPhone.Text = ; private void ADD_Load(object sender, EventArgs e) #region Using Directivesusing System;using System.Data.SqlClient;using Sys
20、tem.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;#endregionnamespace WindowsApplication1 public partial class DELETE : Form string a; public DELETE() InitializeComponent(); private void but
21、ton1_Click(object sender, EventArgs e) a = textBox1.Text; SqlConnection thisConnection = new SqlConnection(Server=00B758EFB68A400;Integrated Security=sspi; + Database=a); SqlDataAdapter thisAdapter = new SqlDataAdapter(SELECT * from 學(xué)籍, thisConnection); SqlCommandBuilder thisBuilder = new SqlCommand
22、Builder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, 學(xué)籍); DataColumn keys = new DataColumn1; keys0 = thisDataSet.Tables學(xué)籍.ColumnsStuNo; thisDataSet.Tables學(xué)籍.PrimaryKey = keys; DataRow findRow = thisDataSet.Tables學(xué)籍.Rows.Find(textBox1 .Text ); if (findRow !=null )
23、findRow.Delete(); thisAdapter.Update(thisDataSet, 學(xué)籍); MessageBox.Show(Information deleted); thisConnection.Close(); private void buttonWarningDCancel_Click(object sender, EventArgs e) this.Close(); private void DELETE_Load(object sender, EventArgs e) private void ButtonFormDeleteEnter_Click(object
24、sender, EventArgs e) string output; SqlConnection thisConnection = new SqlConnection(Server =00b758efb68a400;Integrated Security=sspi; + Database =a); SqlDataAdapter thisAdapter = new SqlDataAdapter(SELECT * from 學(xué)籍, thisConnection); SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter)
25、; DataSet thisDataSet = new DataSet(); thisAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; thisAdapter.Fill(thisDataSet ,學(xué)籍); DataRow findRow = thisDataSet.Tables學(xué)籍.Rows.Find(textBox1.Text); output = StuNo + tt + findRowStuNo + rn + rn + StuName + tt + findRowStuName + rn + rn + Addres
26、s + tt + findRowAddress + rn + rn + ID + tt + findRowID + rn + rn + Phone + tt + findRowPhone + rn ; this.textBox3.Text += output; thisConnection.Close(); #region Using Directivesusing System;using System.Data.SqlClient;using System.Collections.Generic;using System.ComponentModel;using System.Data;u
27、sing System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;#endregionnamespace WindowsApplication1 public partial class SEARCH : Form /string output; public SEARCH() InitializeComponent(); private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private v
28、oid d(object sender, EventArgs e) private void SEARCH_Load(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) try catch(DataException ex) MessageBox.Show(ex.Message.ToString(); private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) pri
29、vate void button1_Click_1(object sender, EventArgs e) Search_by_StuNo no=new Search_by_StuNo() ; no.Show(); this.Hide(); private void button2_Click(object sender, EventArgs e) Search_by_StuName name = new Search_by_StuName(); name.Show(); this.Hide(); #region Using Directivesusing System;using Syste
30、m.Data.SqlClient;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;#endregionnamespace WindowsApplication1 public partial class Search_by_StuName : Form public Search_by_StuName() InitializeComponent(); pr
31、ivate void button1_Click(object sender, EventArgs e) string output=; if (textBox2.Text = null) MessageBox.Show(Please input the StuName); else SqlConnection thisConnection = new SqlConnection(Server =00b758efb68a400;Integrated Security=sspi; + Database =a); SqlDataAdapter thisAdapter = new SqlDataAd
32、apter(select * from 學(xué)籍 where StuName like % + textBox2.Text.ToString() + %, thisConnection); SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; thisAdapter.Fill(thisDataSet, 學(xué)籍); D
33、ataRow findRow = thisDataSet.Tables學(xué)籍.Rows.Find(textBox2.Text); if (findRow = null) MessageBox.Show(ERROR:Nonexistent StuName!); textBox1.Text = ; else output = StuNo + tt + findRowStuNo + rn + rn + StuName + tt + findRowStuName + rn + rn + Address + tt + findRowAddress + rn + rn + ID + tt + findRow
34、ID + rn + rn + Phone + tt + findRowPhone + rn; this.textBox1.Text += output; thisConnection.Close(); private void Search_by_StuName_Load(object sender, EventArgs e) #region Using Directivesusing System;using System.Data.SqlClient;using System.Collections.Generic;using System.ComponentModel;using Sys
35、tem.Data;using System.Drawing;using System.Text;using System.Windows.Forms;#endregionnamespace WindowsApplication1 public partial class Search_by_StuNo : Form public Search_by_StuNo() InitializeComponent(); private void button1_Click(object sender, EventArgs e) string output; if (textBox1.Text = nul
36、l) MessageBox.Show(Please input the StuNo); else SqlConnection thisConnection = new SqlConnection(Server =00b758efb68a400;Integrated Security=sspi; + Database =a); SqlDataAdapter thisAdapter = new SqlDataAdapter(SELECT * from 學(xué)籍, thisConnection); SqlCommandBuilder thisBuilder = new SqlCommandBuilder
37、(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; thisAdapter.Fill(thisDataSet, 學(xué)籍); DataRow findRow = thisDataSet.Tables學(xué)籍.Rows.Find(textBox1.Text); if (findRow = null) MessageBox.Show(ERROR:Nonexistent StuNo!); textBox1.Text = ; e
38、lse output = StuNo + tt + findRowStuNo + rn + rn + StuName + tt + findRowStuName + rn + rn + Address + tt + findRowAddress + rn + rn + ID + tt + findRowID + rn + rn + Phone + tt + findRowPhone + rn; this.textBox2.Text += output; thisConnection.Close(); private void Search_by_StuNo_Load(object sender
39、, EventArgs e) #region Using Directivesusing System;using System.Data.SqlClient;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;#endregionnamespace WindowsApplication1 public partial class ALTER : Form string output1, output2, output3, output4; /string a, b, c, d, f; public ALTER() InitializeComponent(); private void buttonAddClear_Click(object sender, EventArgs e) SqlConnection thisConnection = new SqlConnection(Server =00b758efb68
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 南通科技職業(yè)學(xué)院《數(shù)字通信系統(tǒng)設(shè)計(jì)原理》2023-2024學(xué)年第二學(xué)期期末試卷
- 寧夏財(cái)經(jīng)職業(yè)技術(shù)學(xué)院《服務(wù)設(shè)計(jì)專題》2023-2024學(xué)年第二學(xué)期期末試卷
- 大連航運(yùn)職業(yè)技術(shù)學(xué)院《舞蹈專業(yè)教學(xué)法》2023-2024學(xué)年第二學(xué)期期末試卷
- 益陽醫(yī)學(xué)高等??茖W(xué)?!禘xportMarketing》2023-2024學(xué)年第二學(xué)期期末試卷
- 滄州幼兒師范高等??茖W(xué)?!豆こ淘靸r(jià)管理》2023-2024學(xué)年第二學(xué)期期末試卷
- 冀中職業(yè)學(xué)院《行政職業(yè)能力》2023-2024學(xué)年第二學(xué)期期末試卷
- 江西青年職業(yè)學(xué)院《創(chuàng)業(yè)教育與就業(yè)指導(dǎo)下》2023-2024學(xué)年第二學(xué)期期末試卷
- 黑龍江林業(yè)職業(yè)技術(shù)學(xué)院《小動(dòng)物臨床用藥專題》2023-2024學(xué)年第二學(xué)期期末試卷
- 北京藝術(shù)傳媒職業(yè)學(xué)院《機(jī)械制圖1(下)》2023-2024學(xué)年第二學(xué)期期末試卷
- 2021年電力工程室外落水管及散水施工作業(yè)指導(dǎo)書
- 心衰患者的容量管理中國(guó)專家共識(shí)-共識(shí)解讀
- 個(gè)人投資收款收據(jù)
- H3C全系列產(chǎn)品visio圖標(biāo)庫
- 新生兒常見儀器的使用與維護(hù) 課件
- 工藝能力分析報(bào)告
- 《給校園植物掛牌》課件
- 氣道高反應(yīng)性教學(xué)演示課件
- 健身房眾籌方案
- 護(hù)理帶教匯報(bào)課件
- 蔬菜種植與有機(jī)農(nóng)業(yè)培訓(xùn)
- 新視野大學(xué)英語(第四版)讀寫教程1(思政智慧版)課件 Unit 5 Friendship across border and gender
評(píng)論
0/150
提交評(píng)論