數(shù)據(jù)庫課程設(shè)計52186_第1頁
數(shù)據(jù)庫課程設(shè)計52186_第2頁
數(shù)據(jù)庫課程設(shè)計52186_第3頁
數(shù)據(jù)庫課程設(shè)計52186_第4頁
數(shù)據(jù)庫課程設(shè)計52186_第5頁
已閱讀5頁,還剩18頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、 安徽工業(yè)大學(xué)工商學(xué)院數(shù)據(jù)庫課程設(shè)計報告學(xué)生信息管理系統(tǒng) 姓名:金村界 學(xué)號:141842211 專業(yè):計算機科學(xué)與技術(shù) 班級:計1441 教師:甘麗1、 題目:學(xué)生信息管理系統(tǒng) 學(xué)生信息管理是一個教育單位不可缺少的部分,它的內(nèi)容對于學(xué)校的決策者和管理者來說都是至關(guān)重要的。所以學(xué)生信息管理系統(tǒng)應(yīng)該能夠為用戶提供充足的信息和快捷的查詢手段。本系統(tǒng)采用Microsoft Visual Studio 2010作為開發(fā)工具,Microsoft SQL Server 2012建立數(shù)據(jù)庫,并進行初始數(shù)據(jù)輸入,在進行界面的設(shè)計和代碼的編寫,界面簡潔,功能明確,方便了工作人員的操作。二、開發(fā)工具:Micros

2、oft Visual Studio 2010三、數(shù)據(jù)庫:Microsoft SQL Server 2012 Microsoft SQL Server 2012是一套完整的數(shù)據(jù)庫和分析產(chǎn)品,具有高度的可擴展性和可靠性,對市場的快速反應(yīng)能力強,可以快速構(gòu)建各種業(yè)務(wù)和方案,具有高度的安全性保障。四、操作系統(tǒng):Microsoft windows 10五、功能圖登錄添加更改刪除 查詢6、 用戶視圖與代碼1、登錄頁面using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;usin

3、g System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 測試 public partial class Form1 : Form public Form1() InitializeComponent(); private void label1_Click(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object se

4、nder, EventArgs e) if (comboBox1.Text = "學(xué)生") pictureBox1.Image = Image.FromFile("pic1.jpg"); if (comboBox1.Text = "教師") pictureBox1.Image = Image.FromFile("pic2.jpg"); private void button2_Click(object sender, EventArgs e) string str, sql; str = "Server=

5、.;Database=學(xué)生信息管理系統(tǒng);User id='sa'pwd='167349'" SqlConnection conn = new SqlConnection(str); conn.Open(); sql = "select * from 教師登入表 where zh='" + textBox1.Text + "' and mima='" + textBox2.Text + "'" SqlCommand cmd = new SqlCommand(sql

6、, conn); cmd.CommandType = CommandType.Text; SqlDataReader sdr; sdr = cmd.ExecuteReader(); if (sdr.Read() && comboBox1.Text = "教師") Form3 form2 = new Form3(); form2.Show(); else if (comboBox1.Text = "請選擇") MessageBox.Show("未選擇登錄選項"); else MessageBox.Show("賬

7、號或密碼錯誤!", "錯誤提示", MessageBoxButtons.OK, MessageBoxIcon.Error); private void button3_Click(object sender, EventArgs e) this.Dispose(); 2、功能頁面 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.

8、Text;using System.Windows.Forms;namespace 測試 public partial class Form3 : Form public Form3() InitializeComponent(); private void radioButton1_CheckedChanged(object sender, EventArgs e) private void radioButton2_CheckedChanged(object sender, EventArgs e) private void radioButton3_CheckedChanged(obje

9、ct sender, EventArgs e) private void radioButton4_CheckedChanged(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e) if (radioButton1.Checked) Form4 f = new Form4(); f.Show(); if (radioButton2.Checked) Form5 f = new Form5(); f.Show(); if (radioButton3.Checked) Form6 f

10、= new Form6(); f.Show(); if (radioButton4.Checked) Form7 f = new Form7(); f.Show(); private void button1_Click(object sender, EventArgs e) this.Dispose(); private void groupBox1_Enter(object sender, EventArgs e) private void label2_Click(object sender, EventArgs e) 系統(tǒng)功能:(1) 查詢 using System;using Sys

11、tem.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 測試 public partial class Form4 : Form public Form4() InitializeComponent(); private void dataGridView1_CellCo

12、ntentClick(object sender, DataGridViewCellEventArgs e) private void button1_Click(object sender, EventArgs e) /查詢 string str = "Server=.;Database=學(xué)生信息管理系統(tǒng);User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "Select 姓名,性別,專業(yè),班級

13、0;From stu where 學(xué)號 = '" + textBox1.Text + "'" SqlDataAdapter dr = new SqlDataAdapter(sqlstr,con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1,"stu"); dataGridView1.DataSource = DataSet1.Tables"stu" private void button2_Click

14、(object sender, EventArgs e) this.Dispose(); private void button3_Click(object sender, EventArgs e) Form3 thild = new Form3(); thild.Show(); this.Dispose(); private void Form4_Load(object sender, EventArgs e) (2) 刪除 using System;using System.Collections.Generic;using System.ComponentModel;using Syst

15、em.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 測試 public partial class Form5 : Form public Form5() InitializeComponent(); private void button1_Click(object sender, EventArgs e) string str = "Server=.;Database=學(xué)生信

16、息管理系統(tǒng);User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "Select 姓名,性別,專業(yè),班級 From stu where 學(xué)號 = '" + textBox1.Text + "'" SqlDataAdapter dr = new SqlDataAdapter(sqlstr, con); DataSe

17、t DataSet1 = new DataSet(); dr.Fill(DataSet1, "stu"); dataGridView1.DataSource = DataSet1.Tables"stu" private void button2_Click(object sender, EventArgs e) string str = "Server=.;Database=學(xué)生信息管理系統(tǒng);User id='sa'pwd='167349'" SqlConnection con = new SqlCon

18、nection(str); String sqlstr = "delete  From stu where 學(xué)號='" + textBox1.Text + "'" SqlCommand mycom2 = new SqlCommand(sqlstr, con); con.Open(); mycom2.ExecuteNonQuery(); MessageBox.Show("該學(xué)生信息刪除成功!", "恭喜", MessageBoxButtons.OK,

19、MessageBoxIcon.Information); private void button3_Click(object sender, EventArgs e) Form3 thild = new Form3(); thild.Show(); this.Dispose(); private void button4_Click(object sender, EventArgs e) this.Dispose(); private void Form5_Load(object sender, EventArgs e) (3) 更改 using System;using System.Col

20、lections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 測試 public partial class Form6 : Form public Form6() InitializeComponent(); private void groupBox1_Enter(object send

21、er, EventArgs e) private void textBox2_TextChanged(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e) String Sex; if (radioButton1.Checked = true) Sex = "男" else Sex = "女" string str = "Server=.;Database=學(xué)生信息管理系統(tǒng);User id='sa'pwd='1

22、67349'" SqlConnection con = new SqlConnection(str); String sqlstr = "update stu set 學(xué)號='" + textBox2.Text + "' ,姓名='" + textBox3.Text + "',性別='" + Sex + "',專業(yè)='" + textBox6.Text + "',年齡='&qu

23、ot; + textBox5.Text + "',班級='" + textBox4.Text + "' Where 學(xué)號='" + textBox1.Text + "'" SqlCommand mycom1 = new SqlCommand(sqlstr, con); con.Open(); mycom1.ExecuteNonQuery(); MessageBox.Show("該學(xué)生信息更新成功!", "恭喜", MessageBoxB

24、uttons.OK, MessageBoxIcon.Information); con.Close(); private void button1_Click(object sender, EventArgs e) string str = "Server=.;Database=學(xué)生信息管理系統(tǒng);User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "Select 學(xué)號,姓名,專業(yè),性別,年齡,班級

25、0;From stu where 學(xué)號 = '" + textBox1.Text + "'" SqlDataAdapter dr = new SqlDataAdapter(sqlstr, con); DataSet DataSet1 = new DataSet(); dr.Fill(DataSet1, "stu"); dataGridView1.DataSource = DataSet1.Tables"stu" private void button3_Cli

26、ck_1(object sender, EventArgs e) Form3 fiveth = new Form3(); fiveth.Show(); this.Dispose(); private void Form6_Load(object sender, EventArgs e) (4) 添加 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;

27、using System.Windows.Forms;using System.Data.SqlClient;namespace 測試 public partial class Form7 : Form public Form7() InitializeComponent(); private void label1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) String Sex; if (radioButton1.Checked = true) Sex = "男" else Sex = "女" string str = "Server=.;Database=學(xué)生信息管理系統(tǒng);User id='sa'pwd='167349'" SqlConnection con = new SqlConnection(str); String sqlstr = "insert into stu(學(xué)號,姓名,性別,專業(yè),年齡,班級) 

溫馨提示

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

評論

0/150

提交評論