数据库课程设计学生信息管理系统_第1页
数据库课程设计学生信息管理系统_第2页
数据库课程设计学生信息管理系统_第3页
数据库课程设计学生信息管理系统_第4页
数据库课程设计学生信息管理系统_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

©安徽工业大学工商学院

数据库课程设计报告

学生信息管理系统

姓名:

学号:

专业:计算机科学与技术

班级:计1441

教师:

2017.1.3

-、题目:学生信息管理系统

学生信息管理是一个教育单位不可缺少的部分,它

的内容对于学校的决策者和管理者来说都是至关重要的。所

以学生信息管理系统应该能够为用户提供充足的信息和快

捷的查询手段。本系统采用MicrosoftVisualStudio2010作为

开发工具,MicrosoftSQLServer2012建立数据库,并进行初

始数据输入,在进行界面的设计和代码的编写,界面简洁,

功能明确,方便了工作人员的操作。

二、开发工具:MicrosoftVisualStudio2010

三、数据库:MicrosoftSQLServer2012

MicrosoftSQLServer2012是一套完整的数据库和分析

产品,具有高度的可扩展性和可靠性,对市场的快速反应能

力强,可以快速构建各种业务和方案,具有高度的安全性保

障。

四、操作系统:Microsoftwindows10

五、功能图

登录

、/,,J____

查询删除更改添加

六、用户视图与代码

1、登录页面

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespace测试

|

pub1icpartialclassForm1:Form

publicForml()

{

InitializeConponent();

)

privatevoidlabel1_C1ick(objectsender,EventArgse)

)

privatevoidcomboBoxlSelectedlndexChanged(objectsender,Event.Argse)

(

if(comboBoxl.Text=="学生")

pictureBoxl.Image=Image.FromFile(/,pic\\l.jpg");

if(comboBoxl.Text=="教师")

pictureBoxl.Image=Image.HromEile("pic\\2.jpg");

)

privatevoidbutton2_Click(objectsender,l?ventArgse)

{

stringstr,sql;

str="Server三;Database=学生信息管理系统;Userid='sa';pwd='167349'”;

SqlConnectionconn=newSqlConnection(str);

conn.Open();

sql="select*from教师登入表wherezh='"+textBoxl.Text+andmina=,

+textBox2.Text+

SqlCommandcred-newSqlCommand(sql,conn);

cmd.CommandType=CommandType.Text;

SqlDataReadersdr;

sdr=cmd.ExecuteReader();

if(sdr.Read()&&comboBoxl.Text=="教师")

{

Form3form2=newForm3();form2.Show();

)

elseif(comboBoxl.Text="请选择")

MessagcBox.Sho常("未选择登录选项");

elseMessageBox.Show("账号或密码错误!","错i关提示“,MessageBoxButtons.OK,

MessagcBoxIcon.Error);

)

privatevoidbutton3Click(objectsender,EventArgse)

(

this.DisposeO;

}

)

}

2、功能页面

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Foms;

namespace测试

(

publicpartialclassForm3:Form

{

publicForm3()

{

InitializeConponent();

)

privatevoidradioButtonl_CheckedChanged(objectsender,EventArgse)

{

)

privatevoidradioButton2_CheckedChanged(objectsender,EventArgse)

{

)

privatevoidradioButton3_CheckedChanged(objectsender,EventArgse)

)

privatevoidradioButton4_CheckedChanged(objectsender,EventArgse)

(

)

privatevoidbutlon2_C1ick(objectsender,I:vent.Argse)

(

if(radioButtonl.Checked)

(

Form4f=newForm4();

f.Show();

}

if(radioButton2.Checked)

{

PormSf■newPorm5();

f.Show();

)

if(radioButton3.Checked)

(

Form6f=newForm6();

f.Show();

}

if(radioButtond.Checked)

(

Eorm7f=newForm7();

f.Show();

}

)

privatevoidbutton1_Click(objectsender,EvertArgse)

{

this.Dispose!);

)

privatevoidgroupBoxl_Enter(objectsender,EventArgse)

{

)

privatevoidlabe12_Click(objectsender,EventArgse)

)

)

系统功能:

(1)查询

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data:

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Eorns;

usingSystem.Data.SqlClicnt;

namespace测试

(

publicpartialclassForm!:Form

{

publicForm4()

(

InitializeCoriponent();

)

privatevoiddataGridViewlCelIContentClick(objectsender,

I);ii;iGridViewCcllEvcntA)<c)

)

privatevoidbutlonl_Click(objectsender,EventArgse)〃查询

|

stringstr="Server=.;Database=学生信息管理系统;Userid='sa';pwd=,1673491*;

SqlConnectioncon=newSqlConnection(str);

Stringsqlstr=*Select姓名,性别,专业,班级Fromstuwhere学号='"+

textBoxl.Text+

SqlDataAdapterdr=newSqlDataAdapter(sqlstr,con);

DataSetDataSet1=newDataSet();

dr.Fi11(DataSet1,"stu");

dataGridViewl.DataSource=DataSetl.TablcsE'stu'];

)

privatevoidbutton2Click(objectsender,EventArgse)

(

this.Disposed);

)

privatevoidbutton3_C1ick(objectsender,EventArgse)

{

Form3thiId=newForm3();thiId.Show();

this.DisposeO;

}

privatevoidForri4_Load(objectsender,EventArgse)

{

)

}

}

(2)删除

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlCIient;

namespace测试

(

publicpartialclassl'orm5:Form

(

publicForm5()

(

InitializeConiponent();

)

privatevoidbuttonlClick(objectsender,Event.Argse)

(

stringstr=*Server=.;Database学生信息管理系统;Userid='sa';pwd=,167349**;

SqlConnectioncon=newSqlConnection(str);

Stringsqlstr=*Select姓名,性别,专业,班级Fromstuwhere学号='"+

textBoxl.Text+;

SqlDataAdapterdr=newAlDataAdapter(sqlstr,con);

DataSetDataSet1=newDataSet();

dr.Fill(DataSet1,*stu*);

dataGridViewl.DataSource=DataSetl.Tables[z,stu/,];

)

privatevoidbutton2_Click(objectsender,EventArgse)

{

stringstr="Server=.;Database=学生信息管理系统;Userid='sa';pwd=,167349*

SqlConnectioncon=newSqlConncction(str);

Stringsqlstr=^deleteFromstuwhere学号"+textBoxl.Text+

SqlConmiandmycom2=newSqlCommand(sqlstr,con);

con.Open();

mycom2.ExecuteNonQuery();

McssageBox.Show("该学生信息删除成功!","恭喜",MessageBoxButtons.OK,

MessagoBoxIcon.Information);

)

privatevoidbutton3_Click(objectsender,EventArgse)

(

Form3thiId=newEorm3();thiId.Show();

this.Dispose。;

)

privatevoidbutton4Click(objectsender,EventArgse)

(

this.Disposed);

)

privatevoidEorro5I.oad(objectsender,EventArgse)

{

}

}

}

(3)更改

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Foms;

usingSystem.Data.SqlClient;

namespace测试

(

publicpartialclassForm6:Form

(

publicForm6()

(

InitializeCoraponent();

)

privatevoidgroupBox1Enter(objectsender,EventArgse)

{

)

privatevoidtextBox2_TextChanged(objectsender,FventArgse)

)

privatevoidbutton2_C1ick(objcctsender,EvenIArgsc)

{

StringSex;

if(radioButtonl.Checked==true){Sex="男";}

else

{Sex="女";}

stringstr="Serverj;Database=学生信息管理系统;Userid='sa':pwd=,167349*

SqlConnectioncon=newSqlConnection(str);

Stringsqlstr="updatestuset学号='"+textBox2.Text+,姓名='"+

textBox3.Text+,性别='*+Sex+,专业='"+textBox6.Text+,年龄='"+textBox5.Text

+,班级"+textBox4.Text+Where学号"+textBoxl.Text+

SqlCommandmycoml=newSqlCommand(sqlstr,con):

con.OpenO;

mycoml.ExecuteNonQuery();

agcBox.Show("该学生信息更新成功!","恭喜",MessageBoxBultons.OK,

MessageBoxIcon.Information);

con.CloseO;

)

privatevoidbuttonl_Click(objectsender,EvcntArgse)

{

stringstr="Servers;Database=学生信息管理系统;Userid='sa';pwd='167349'

SqlConnectioncon=newSqlConnection(str);

Stringsqlstr=*Select学号,姓名,专业,性别,年龄,班级Fromstuwhere学

号=+textBoxl.Text+

SqlDataAdapterdr=newSq1DataAdapter(sqIstr,con);

DataSetDataSet!=newDataSet();

dr.Ei11(DataSet1,"stu");

dataGridViewl.DataSource=DataSet1.Tables[/zstuz,];

)

privatevoidbutton3Click1(objectsender,EventArgse)

(

Form3fiveth=newForm3();

fiveth.Show();this.DisposeO;

)

privatevoidForn6_Load(objectsender,EventArgse)

)

}

(4)添加

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Unq;

usingSystem.Text;

usingSystem.Windows.Forns;

usingSystem.Data.SqlClient;

namespace测试

|

pub1icpartialclassForm7:Form

{

publicForm7()

{

InitializeCoiiponent();

)

privatevoidlabell_Click(objectsender,Even!Argse)

)

privatevoidbuttonl_Click(objectsender,EventArgsc)

|

StringSex;

if(radioButtonl.Checked==true){Sex="男";}

else

{Sex="女";}

stringstr="Serverj;Database=学生信息管理系统;"erid='sa';pwd='167349'

SqIConnectioncon=newSqlConnection(str);

Stringsqlstr="insertintostu(学号,姓名,性别,专业,年龄,班

级)values(+textBoxl.Text+,+textBox2.Text+"+Sex++

textBox3.Text+"+textBox4.Text+"+textBox5.Text+

SqlCommandmycoml=newSqlCommand(sqlstr,con):

con.OpenO;

mycoml.ExecuteNonQuery();

agcBox.Show("该学生信息添加成功!","恭喜",MessageBoxBu11oris.OK,

MessageBoxIcon.Information);

con.CloseO;

)

privatevoidbutton2_Click(objectsender,EventArgse)

{

Form3fiveth=newForm3();

fiveth.Show();

this.Disposed);

)

privatevoidbutton3_Click(objectsender,EventArgse)

|

this.DisposeO;

)

privatevoidForm?Load(objectsender,EventArgse)

(

}

)

}

七、总结

通过两三天的编程和调试以及实验报告的撰写,最终还

是做了一个小型数据库应用程序的开发。预先设想的功能经

过查阅资料和询问同学基本得以实现。尽管在做的过程中存

在了很多的错误,花了很多的时间去改正,最后还是做成功

了。通过本实验我收获很多。今后对于每一科目的每一次的

上机实验,,我都会认真的对待,并及时进行总结,以不断

提升自己的能力G

参考资料:数据库基础与应用

Visualc#.NET程序设计实用教程

目录

第一章总论

一、项目提要...............................

二、可行性研究报告编制依据...............

三、综合评价和论证结论....................

四、存在问题与建议........................

第二章项目背景及必要性....................

一、项目建设背景..........................

二、项目区农业产业化经营发展现状........

三、项目建设的必要性及目的意义

第三章建设条件.............................

一、项目区概况.............................

二、项目实施的有利条件....................

第四章建设单位基本情况....................

一、建设单位概况..........................

二、研发能力...............................

三、财务状况...............................

第五章市场分析与销售方案..................

一、市场分析...............................

二、产品生产及绡售方案....................

三、销售策略及营销模式....................

四、销售队伍和销售网络建设...............

第六章项目建设方案.........................

一、建设任务和规模........................

二、项目规划和布局........................

三、生产技术方案与工艺流程...............

四、项目建设标准和具体建设内容..........

五、项目实施进度安排......................

第七章投资估算和资金筹措

一、投资估算依据...........................

二、项目建设投资估算......................

三、资金来源

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论