当前位置:首页 > 教学设计 > 学生信息管理系统课程设计报告-,图文 学生信息管理系统课程设计
 

学生信息管理系统课程设计报告-,图文 学生信息管理系统课程设计

发布时间:2019-07-19 05:25:30 影响了:

目录

第一章概述4

1.1设计目的4

1.2开发工具的选择4

1.3开发环境4

1.4 本报告的主要内容4

第二章需求分析5

2.1 系统需求简介5

2.1.15

2.1.2 功能需求的分析5

2.1.3 性能需求分析5

第三章总体设计6

3.1 设计概述6

3.2 系统总体结构及功能模块划分6

3.2.1学生成绩查询模块6

3.2.2学生信息管理模块7

3.3系统数据库概念结构设计7

3.3.1系统E-R图7

3.4.1 用户登录安全性8

第四章详细设计9

4.1 概述9

4.2 系统程序流程图9

4.3 系统主要功能模块简介10

4.3.1 系统登录10

4.3.2 学生信息添加模块11

4.3.3学生信息删除模块12

4.3.4 学生信息查找模块13

4.3.5 学生信息修改模块14

第五章程序设计总结15

第六章结束语16

参考文献17

附录18

程序代码18

第一章概述

1.1设计目的

本课程设计的目的是使学生能熟练掌握简单的Window窗体应用程序的设计和ADD.net的应用,希望通过本次的锻炼学生实用c#语言解决实际问题的能力。

1.2开发工具的选择

本系统后台数据库采用Microsoft SQL Server 数据库,该数据库系统在安全性、准确性和运行速度方面有绝对的优势,并且处理数据量大、效率高;
前台采用Microsoft 公司的Visual Studio 2008 作为主要的开发工具,可与SQL Server 2008 数据库无缝连接。

1.3开发环境

系统开发平台:Microsoft Visual Studio2008

系统开发语言:C#

数据库管理软件:SQL Server 2005

1.4 本报告的主要内容

本报告详细的介绍了学生的信息管理的开发过程,主要设计到的工作如下:系统的需求分析、系统的总设计、系统的概念设计、系统各模块的详细设计、系统运行与测试。

第二章需求分析

2.1 系统需求简介

2.1.1

(1)根据查询条件实现学生信息的查询

(2)学生信息的添加、删除、修改

(3)对基本信息完成的增加、删除、修改时,需要注意表与表之间的关联

2.1.2 功能需求的分析

本系统的功能需求分析如下:

学生信息查询:学生可以根据学号、姓名进行查询

学生信息管理:主要是用于学生信息更改、插入、删除

学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新

2.1.3 性能需求分析

(1)登录、用户界面需求:简洁、易懂、易用、有好的用户界面

(2)安全保密需求:只有凭借用户名和密码登录系统,才能进行信息的管理。

第三章总体设计

3.1 设计概述

根据需求把整体系统分化成不同的模块,每个模块完成一个特性的子功能。把着些模块结合起来组成一个整体。逐一实现各种功能。

3.2 系统总体结构及功能模块划分

经过对系统的需求分析,学生信息管理系统主要划分为三部分:学生信息查询,学生信息管理,学生成绩录入三个功能模块。如图3.2.1

学生成绩录入

图3.2.1 系统的总体结构

3.2.1学生成绩查询模块

学生信息查询:学生可以根据学号、姓名、专业进行查询。如图3.2.2学生信息查询模块结构

姓名查询

图3.2.2学生信息管理模块结构

3.2.2学生信息管理模块

学生信息管理:主要是用于学生信息更新、插入、删除,如图3.2.3学生管理模块结构

基本信息录入

图3.2.3 学生信息管理模块结构

3.3系统数据库概念结构设计

根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及他们之间的关系,为后面的逻辑结构设计打下基础。

3.3.1系统E-R图

系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。如图3.3.1系统E-R图结构

学分

图3.3.1 系统E-R图结构

3.4.1 用户登录安全性

系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。

第四章详细设计

4.1 概述

详细设计阶段的根本目标是确定应该怎么样具有的实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写的程序。

4.2 系统程序流程图

程序流程图又称为程序框架图,它是历史悠久使用最广泛的描述软件的方法。它可将整个程序的总体流程清楚明白的显示出来。如图4.2.1 系统总流程图结构。

结束

图4.2.1 系统总体流程图

4.3 系统主要功能模块简介

4.3.1 系统登录

用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4.3.1 用户登录界面所示。

图4.3.1 用户登陆界面

4.3.2 学生信息添加模块

学生信息添加:在程序主界面(图4.3.2 程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图4.3.3 所示)。

图4.3.2 程序主界面

图4.3.3 信息添加界面

4.3.3学生信息删除模块

学生信息删除:信息删除模块如图4.3.4,可以通过删除模块进行学号或姓名进行信息的删除。

图4.3.4 信息删除界面

4.3.4 学生信息查找模块

学生信息查找:信息查找模块如图4.3.5,可以通过查找模块进行学号或姓名的查找。

图4.3.5 信息查找界面

4.3.5 学生信息修改模块

学生信息修改:信息修改如图4.3.6,可以通过修改模块进行信息的修改。

图4.3.6信息修改界面

第五章程序设计总结

在编程期间,不遇到点困哪似乎是不可能的,正是这些困难,我们才能会收到成功的喜悦,我们才能乐此不疲的进行下去。这是我对此次编程的最大感悟。

关键词数据库,添加,修改,查找,删除

目录

第一章概述4

1.1设计目的4

1.2开发工具的选择4

1.3开发环境4

1.4 本报告的主要内容4

第二章需求分析5

2.1 系统需求简介5

2.1.15

2.1.2 功能需求的分析5

2.1.3 性能需求分析5

第三章总体设计6

3.1 设计概述6

3.2 系统总体结构及功能模块划分6

3.2.1学生成绩查询模块6

3.2.2学生信息管理模块7

3.3系统数据库概念结构设计7

3.3.1系统E-R图7

3.4.1 用户登录安全性8

第四章详细设计9

4.1 概述9

4.2 系统程序流程图9

4.3 系统主要功能模块简介10

4.3.1 系统登录10

4.3.2 学生信息添加模块11

4.3.3学生信息删除模块12

4.3.4 学生信息查找模块13

4.3.5 学生信息修改模块14

第五章程序设计总结15

第六章结束语16

参考文献17

附录18

程序代码18

第一章概述

1.1设计目的

本课程设计的目的是使学生能熟练掌握简单的Window窗体应用程序的设计和ADD.net的应用,希望通过本次的锻炼学生实用c#语言解决实际问题的能力。

1.2开发工具的选择

本系统后台数据库采用Microsoft SQL Server 数据库,该数据库系统在安全性、准确性和运行速度方面有绝对的优势,并且处理数据量大、效率高;
前台采用Microsoft 公司的Visual Studio 2008 作为主要的开发工具,可与SQL Server 2008 数据库无缝连接。

1.3开发环境

系统开发平台:Microsoft Visual Studio2008

系统开发语言:C#

数据库管理软件:SQL Server 2005

1.4 本报告的主要内容

本报告详细的介绍了学生的信息管理的开发过程,主要设计到的工作如下:系统的需求分析、系统的总设计、系统的概念设计、系统各模块的详细设计、系统运行与测试。

第二章需求分析

2.1 系统需求简介

2.1.1

(1)根据查询条件实现学生信息的查询

(2)学生信息的添加、删除、修改

(3)对基本信息完成的增加、删除、修改时,需要注意表与表之间的关联

2.1.2 功能需求的分析

本系统的功能需求分析如下:

学生信息查询:学生可以根据学号、姓名进行查询

学生信息管理:主要是用于学生信息更改、插入、删除

学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新

2.1.3 性能需求分析

(1)登录、用户界面需求:简洁、易懂、易用、有好的用户界面

(2)安全保密需求:只有凭借用户名和密码登录系统,才能进行信息的管理。

第三章总体设计

3.1 设计概述

根据需求把整体系统分化成不同的模块,每个模块完成一个特性的子功能。把着些模块结合起来组成一个整体。逐一实现各种功能。

3.2 系统总体结构及功能模块划分

经过对系统的需求分析,学生信息管理系统主要划分为三部分:学生信息查询,学生信息管理,学生成绩录入三个功能模块。如图3.2.1

学生成绩录入

图3.2.1 系统的总体结构

3.2.1学生成绩查询模块

学生信息查询:学生可以根据学号、姓名、专业进行查询。如图3.2.2学生信息查询模块结构

姓名查询

图3.2.2学生信息管理模块结构

3.2.2学生信息管理模块

学生信息管理:主要是用于学生信息更新、插入、删除,如图3.2.3学生管理模块结构

基本信息录入

图3.2.3 学生信息管理模块结构

3.3系统数据库概念结构设计

根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及他们之间的关系,为后面的逻辑结构设计打下基础。

3.3.1系统E-R图

系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。如图3.3.1系统E-R图结构

学分

图3.3.1 系统E-R图结构

3.4.1 用户登录安全性

系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。

第四章详细设计

4.1 概述

详细设计阶段的根本目标是确定应该怎么样具有的实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写的程序。

4.2 系统程序流程图

程序流程图又称为程序框架图,它是历史悠久使用最广泛的描述软件的方法。它可将整个程序的总体流程清楚明白的显示出来。如图4.2.1 系统总流程图结构。

结束

图4.2.1 系统总体流程图

4.3 系统主要功能模块简介

4.3.1 系统登录

用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4.3.1 用户登录界面所示。

图4.3.1 用户登陆界面

4.3.2 学生信息添加模块

学生信息添加:在程序主界面(图4.3.2 程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图4.3.3 所示)。

图4.3.2 程序主界面

图4.3.3 信息添加界面

4.3.3学生信息删除模块

学生信息删除:信息删除模块如图4.3.4,可以通过删除模块进行学号或姓名进行信息的删除。

图4.3.4 信息删除界面

4.3.4 学生信息查找模块

学生信息查找:信息查找模块如图4.3.5,可以通过查找模块进行学号或姓名的查找。

图4.3.5 信息查找界面

4.3.5 学生信息修改模块

学生信息修改:信息修改如图4.3.6,可以通过修改模块进行信息的修改。

图4.3.6信息修改界面

第五章程序设计总结

在编程期间,不遇到点困哪似乎是不可能的,正是这些困难,我们才能会收到成功的喜悦,我们才能乐此不疲的进行下去。这是我对此次编程的最大感悟。

下面来看看编写的艰辛历程:在刚开始的阶段,我经常因为单词的拼错出现这样或那样的错误在数次的错误后我吸取教训在后来的编程中几乎不出现了这种错误。剩下的错误就是引用或语法上的错误。感到最深刻的是,窗体name后就不能随意更改了,更改后在编写的程序的程序中要相应的更新里面的内容。当出现语法错误时我因经验的不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要的结果。成功后留下的就是经验和成就感了,在经验和成就感的陪伴下我充满着信心、激情和执着。期间还有很多老师和同学的帮助。从中感受到了互动的优势和群众的力量。

第六章结束语

为期九周的课程设计结束了,在王老师辛勤代理及同学们的帮助下我逐渐的掌握了一些编程的基本知识!毕竟我完成了教育部给我们规定的任务,期间,总有很多感触。内心充满了感激之情,特别是我们的班主任王老师,在微机房里为我们一遍又一遍的从零点讲起细心教导,在我们编程过程中又一个一个的询问我们的掌握情况。不论遇到什么问题,想想我们的老师,我们总会充满信心。在老师的关怀下我成功了!此时,言语已无法表达我对老师的感激了!此时无声胜有声!

参考文献

[1]王山,萨师煊.高等教育出版社.数据库系统概论.

[2]王磊.实验教程.

[3]袁庆龙,候文义.Ni-P合金镀层组织形貌及显微硬度研究[J].太原理工大学学报,2001,32(1):51-53 .

[4]刘国钧,王连成.图书馆史研究[M].北京:高等教育出版社,1979:15-18,31.

[5]孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22.

[6]张和生.地质力学系统理论[D.太原:太原理工大学,1998.

[7]冯西桥.核反应堆压力容器的LBB分析[R].北京:清华大学核能技术设计研究院,1997.

[8]姜锡洲.一种温热外敷药制备方案[P].中国专利:881056078,1983-08-12.

4.3 系统主要功能模块简介10

4.3.1 系统登录10

4.3.2 学生信息添加模块11

4.3.3学生信息删除模块12

4.3.4 学生信息查找模块13

4.3.5 学生信息修改模块14

第五章程序设计总结15

第六章结束语16

参考文献17

附录18

程序代码18

第一章概述

1.1设计目的

本课程设计的目的是使学生能熟练掌握简单的Window窗体应用程序的设计和ADD.net的应用,希望通过本次的锻炼学生实用c#语言解决实际问题的能力。

1.2开发工具的选择

本系统后台数据库采用Microsoft SQL Server 数据库,该数据库系统在安全性、准确性和运行速度方面有绝对的优势,并且处理数据量大、效率高;
前台采用Microsoft 公司的Visual Studio 2008 作为主要的开发工具,可与SQL Server 2008 数据库无缝连接。

1.3开发环境

系统开发平台:Microsoft Visual Studio2008

系统开发语言:C#

数据库管理软件:SQL Server 2005

1.4 本报告的主要内容

本报告详细的介绍了学生的信息管理的开发过程,主要设计到的工作如下:系统的需求分析、系统的总设计、系统的概念设计、系统各模块的详细设计、系统运行与测试。

第二章需求分析

2.1 系统需求简介

2.1.1

(1)根据查询条件实现学生信息的查询

(2)学生信息的添加、删除、修改

(3)对基本信息完成的增加、删除、修改时,需要注意表与表之间的关联

2.1.2 功能需求的分析

本系统的功能需求分析如下:

学生信息查询:学生可以根据学号、姓名进行查询

学生信息管理:主要是用于学生信息更改、插入、删除

学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新

2.1.3 性能需求分析

(1)登录、用户界面需求:简洁、易懂、易用、有好的用户界面

(2)安全保密需求:只有凭借用户名和密码登录系统,才能进行信息的管理。

第三章总体设计

3.1 设计概述

根据需求把整体系统分化成不同的模块,每个模块完成一个特性的子功能。把着些模块结合起来组成一个整体。逐一实现各种功能。

3.2 系统总体结构及功能模块划分

经过对系统的需求分析,学生信息管理系统主要划分为三部分:学生信息查询,学生信息管理,学生成绩录入三个功能模块。如图3.2.1

学生成绩录入

图3.2.1 系统的总体结构

3.2.1学生成绩查询模块

学生信息查询:学生可以根据学号、姓名、专业进行查询。如图3.2.2学生信息查询模块结构

姓名查询

图3.2.2学生信息管理模块结构

3.2.2学生信息管理模块

学生信息管理:主要是用于学生信息更新、插入、删除,如图3.2.3学生管理模块结构

基本信息录入

图3.2.3 学生信息管理模块结构

3.3系统数据库概念结构设计

根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及他们之间的关系,为后面的逻辑结构设计打下基础。

3.3.1系统E-R图

系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。如图3.3.1系统E-R图结构

学分

图3.3.1 系统E-R图结构

3.4.1 用户登录安全性

系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。

第四章详细设计

4.1 概述

详细设计阶段的根本目标是确定应该怎么样具有的实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写的程序。

4.2 系统程序流程图

程序流程图又称为程序框架图,它是历史悠久使用最广泛的描述软件的方法。它可将整个程序的总体流程清楚明白的显示出来。如图4.2.1 系统总流程图结构。

结束

图4.2.1 系统总体流程图

4.3 系统主要功能模块简介

4.3.1 系统登录

用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4.3.1 用户登录界面所示。

图4.3.1 用户登陆界面

4.3.2 学生信息添加模块

学生信息添加:在程序主界面(图4.3.2 程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图4.3.3 所示)。

图4.3.2 程序主界面

图4.3.3 信息添加界面

4.3.3学生信息删除模块

学生信息删除:信息删除模块如图4.3.4,可以通过删除模块进行学号或姓名进行信息的删除。

图4.3.4 信息删除界面

4.3.4 学生信息查找模块

学生信息查找:信息查找模块如图4.3.5,可以通过查找模块进行学号或姓名的查找。

图4.3.5 信息查找界面

4.3.5 学生信息修改模块

学生信息修改:信息修改如图4.3.6,可以通过修改模块进行信息的修改。

图4.3.6信息修改界面

第五章程序设计总结

在编程期间,不遇到点困哪似乎是不可能的,正是这些困难,我们才能会收到成功的喜悦,我们才能乐此不疲的进行下去。这是我对此次编程的最大感悟。

下面来看看编写的艰辛历程:在刚开始的阶段,我经常因为单词的拼错出现这样或那样的错误在数次的错误后我吸取教训在后来的编程中几乎不出现了这种错误。剩下的错误就是引用或语法上的错误。感到最深刻的是,窗体name后就不能随意更改了,更改后在编写的程序的程序中要相应的更新里面的内容。当出现语法错误时我因经验的不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要的结果。成功后留下的就是经验和成就感了,在经验和成就感的陪伴下我充满着信心、激情和执着。期间还有很多老师和同学的帮助。从中感受到了互动的优势和群众的力量。

第六章结束语

为期九周的课程设计结束了,在王老师辛勤代理及同学们的帮助下我逐渐的掌握了一些编程的基本知识!毕竟我完成了教育部给我们规定的任务,期间,总有很多感触。内心充满了感激之情,特别是我们的班主任王老师,在微机房里为我们一遍又一遍的从零点讲起细心教导,在我们编程过程中又一个一个的询问我们的掌握情况。不论遇到什么问题,想想我们的老师,我们总会充满信心。在老师的关怀下我成功了!此时,言语已无法表达我对老师的感激了!此时无声胜有声!

参考文献

[1]王山,萨师煊.高等教育出版社.数据库系统概论.

[2]王磊.实验教程.

[3]袁庆龙,候文义.Ni-P合金镀层组织形貌及显微硬度研究[J].太原理工大学学报,2001,32(1):51-53 .

[4]刘国钧,王连成.图书馆史研究[M].北京:高等教育出版社,1979:15-18,31.

[5]孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22.

[6]张和生.地质力学系统理论[D.太原:太原理工大学,1998.

[7]冯西桥.核反应堆压力容器的LBB分析[R].北京:清华大学核能技术设计研究院,1997.

[8]姜锡洲.一种温热外敷药制备方案[P].中国专利:881056078,1983-08-12.

[9]GB/T 16159—1996,汉语拼音正词法基本规则[S].北京:中国标准出版社,1996.

[10]谢希德.创造学习的思路[N].人民日报,1998-12-25(10).

[11]王明亮.中国学术期刊标准化数据库系统工程的[EB/OL].

附录

程序代码

登陆程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormLogin : Form

{

public FormLogin()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

int total = new SQLHelper().login(textBoxusername.Text.Trim(), textBoxpassword.Text.Trim());

if (total > 0)

{

FormMain main = new FormMain();

main.Show();

this.Hide();

}

第二章需求分析

2.1 系统需求简介

2.1.1

(1)根据查询条件实现学生信息的查询

(2)学生信息的添加、删除、修改

(3)对基本信息完成的增加、删除、修改时,需要注意表与表之间的关联

2.1.2 功能需求的分析

本系统的功能需求分析如下:

学生信息查询:学生可以根据学号、姓名进行查询

学生信息管理:主要是用于学生信息更改、插入、删除

学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新

2.1.3 性能需求分析

(1)登录、用户界面需求:简洁、易懂、易用、有好的用户界面

(2)安全保密需求:只有凭借用户名和密码登录系统,才能进行信息的管理。

第三章总体设计

3.1 设计概述

根据需求把整体系统分化成不同的模块,每个模块完成一个特性的子功能。把着些模块结合起来组成一个整体。逐一实现各种功能。

3.2 系统总体结构及功能模块划分

经过对系统的需求分析,学生信息管理系统主要划分为三部分:学生信息查询,学生信息管理,学生成绩录入三个功能模块。如图3.2.1

学生成绩录入

图3.2.1 系统的总体结构

3.2.1学生成绩查询模块

学生信息查询:学生可以根据学号、姓名、专业进行查询。如图3.2.2学生信息查询模块结构

姓名查询

图3.2.2学生信息管理模块结构

3.2.2学生信息管理模块

学生信息管理:主要是用于学生信息更新、插入、删除,如图3.2.3学生管理模块结构

基本信息录入

图3.2.3 学生信息管理模块结构

3.3系统数据库概念结构设计

根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及他们之间的关系,为后面的逻辑结构设计打下基础。

3.3.1系统E-R图

系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。如图3.3.1系统E-R图结构

学分

图3.3.1 系统E-R图结构

3.4.1 用户登录安全性

系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。

第四章详细设计

4.1 概述

详细设计阶段的根本目标是确定应该怎么样具有的实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写的程序。

4.2 系统程序流程图

程序流程图又称为程序框架图,它是历史悠久使用最广泛的描述软件的方法。它可将整个程序的总体流程清楚明白的显示出来。如图4.2.1 系统总流程图结构。

结束

图4.2.1 系统总体流程图

4.3 系统主要功能模块简介

4.3.1 系统登录

用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4.3.1 用户登录界面所示。

图4.3.1 用户登陆界面

4.3.2 学生信息添加模块

学生信息添加:在程序主界面(图4.3.2 程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图4.3.3 所示)。

图4.3.2 程序主界面

图4.3.3 信息添加界面

4.3.3学生信息删除模块

学生信息删除:信息删除模块如图4.3.4,可以通过删除模块进行学号或姓名进行信息的删除。

图4.3.4 信息删除界面

4.3.4 学生信息查找模块

学生信息查找:信息查找模块如图4.3.5,可以通过查找模块进行学号或姓名的查找。

图4.3.5 信息查找界面

4.3.5 学生信息修改模块

学生信息修改:信息修改如图4.3.6,可以通过修改模块进行信息的修改。

图4.3.6信息修改界面

第五章程序设计总结

在编程期间,不遇到点困哪似乎是不可能的,正是这些困难,我们才能会收到成功的喜悦,我们才能乐此不疲的进行下去。这是我对此次编程的最大感悟。

下面来看看编写的艰辛历程:在刚开始的阶段,我经常因为单词的拼错出现这样或那样的错误在数次的错误后我吸取教训在后来的编程中几乎不出现了这种错误。剩下的错误就是引用或语法上的错误。感到最深刻的是,窗体name后就不能随意更改了,更改后在编写的程序的程序中要相应的更新里面的内容。当出现语法错误时我因经验的不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要的结果。成功后留下的就是经验和成就感了,在经验和成就感的陪伴下我充满着信心、激情和执着。期间还有很多老师和同学的帮助。从中感受到了互动的优势和群众的力量。

第六章结束语

为期九周的课程设计结束了,在王老师辛勤代理及同学们的帮助下我逐渐的掌握了一些编程的基本知识!毕竟我完成了教育部给我们规定的任务,期间,总有很多感触。内心充满了感激之情,特别是我们的班主任王老师,在微机房里为我们一遍又一遍的从零点讲起细心教导,在我们编程过程中又一个一个的询问我们的掌握情况。不论遇到什么问题,想想我们的老师,我们总会充满信心。在老师的关怀下我成功了!此时,言语已无法表达我对老师的感激了!此时无声胜有声!

参考文献

[1]王山,萨师煊.高等教育出版社.数据库系统概论.

[2]王磊.实验教程.

[3]袁庆龙,候文义.Ni-P合金镀层组织形貌及显微硬度研究[J].太原理工大学学报,2001,32(1):51-53 .

[4]刘国钧,王连成.图书馆史研究[M].北京:高等教育出版社,1979:15-18,31.

[5]孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22.

[6]张和生.地质力学系统理论[D.太原:太原理工大学,1998.

[7]冯西桥.核反应堆压力容器的LBB分析[R].北京:清华大学核能技术设计研究院,1997.

[8]姜锡洲.一种温热外敷药制备方案[P].中国专利:881056078,1983-08-12.

[9]GB/T 16159—1996,汉语拼音正词法基本规则[S].北京:中国标准出版社,1996.

[10]谢希德.创造学习的思路[N].人民日报,1998-12-25(10).

[11]王明亮.中国学术期刊标准化数据库系统工程的[EB/OL].

附录

程序代码

登陆程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormLogin : Form

{

public FormLogin()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

int total = new SQLHelper().login(textBoxusername.Text.Trim(), textBoxpassword.Text.Trim());

if (total > 0)

{

FormMain main = new FormMain();

main.Show();

this.Hide();

}

else

{

MessageBox.Show("用户名或密码错误", "提示");

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

}

主函数程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormMain : Form

{

public FormMain()

{

InitializeComponent();

}

private void 信息录入ToolStripMenuItem_Click(object sender, EventArgs e)

图3.3.1 系统E-R图结构

3.4.1 用户登录安全性

系统设计了登陆界面,每个合法用户有用户名及密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。

第四章详细设计

4.1 概述

详细设计阶段的根本目标是确定应该怎么样具有的实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某个程序设计语言写的程序。

4.2 系统程序流程图

程序流程图又称为程序框架图,它是历史悠久使用最广泛的描述软件的方法。它可将整个程序的总体流程清楚明白的显示出来。如图4.2.1 系统总流程图结构。

结束

图4.2.1 系统总体流程图

4.3 系统主要功能模块简介

4.3.1 系统登录

用户凭借用户名及密码登录,成功登录后可以对学生信息进行操作。用户界面如图4.3.1 用户登录界面所示。

图4.3.1 用户登陆界面

4.3.2 学生信息添加模块

学生信息添加:在程序主界面(图4.3.2 程序主界面)通过信息录入项进入信息添加模块。通过此模块,学生可以向数据库中添加学号、姓名、生日及选择性别。(如图4.3.3 所示)。

图4.3.2 程序主界面

图4.3.3 信息添加界面

4.3.3学生信息删除模块

学生信息删除:信息删除模块如图4.3.4,可以通过删除模块进行学号或姓名进行信息的删除。

图4.3.4 信息删除界面

4.3.4 学生信息查找模块

学生信息查找:信息查找模块如图4.3.5,可以通过查找模块进行学号或姓名的查找。

图4.3.5 信息查找界面

4.3.5 学生信息修改模块

学生信息修改:信息修改如图4.3.6,可以通过修改模块进行信息的修改。

图4.3.6信息修改界面

第五章程序设计总结

在编程期间,不遇到点困哪似乎是不可能的,正是这些困难,我们才能会收到成功的喜悦,我们才能乐此不疲的进行下去。这是我对此次编程的最大感悟。

下面来看看编写的艰辛历程:在刚开始的阶段,我经常因为单词的拼错出现这样或那样的错误在数次的错误后我吸取教训在后来的编程中几乎不出现了这种错误。剩下的错误就是引用或语法上的错误。感到最深刻的是,窗体name后就不能随意更改了,更改后在编写的程序的程序中要相应的更新里面的内容。当出现语法错误时我因经验的不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要的结果。成功后留下的就是经验和成就感了,在经验和成就感的陪伴下我充满着信心、激情和执着。期间还有很多老师和同学的帮助。从中感受到了互动的优势和群众的力量。

第六章结束语

为期九周的课程设计结束了,在王老师辛勤代理及同学们的帮助下我逐渐的掌握了一些编程的基本知识!毕竟我完成了教育部给我们规定的任务,期间,总有很多感触。内心充满了感激之情,特别是我们的班主任王老师,在微机房里为我们一遍又一遍的从零点讲起细心教导,在我们编程过程中又一个一个的询问我们的掌握情况。不论遇到什么问题,想想我们的老师,我们总会充满信心。在老师的关怀下我成功了!此时,言语已无法表达我对老师的感激了!此时无声胜有声!

参考文献

[1]王山,萨师煊.高等教育出版社.数据库系统概论.

[2]王磊.实验教程.

[3]袁庆龙,候文义.Ni-P合金镀层组织形貌及显微硬度研究[J].太原理工大学学报,2001,32(1):51-53 .

[4]刘国钧,王连成.图书馆史研究[M].北京:高等教育出版社,1979:15-18,31.

[5]孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22.

[6]张和生.地质力学系统理论[D.太原:太原理工大学,1998.

[7]冯西桥.核反应堆压力容器的LBB分析[R].北京:清华大学核能技术设计研究院,1997.

[8]姜锡洲.一种温热外敷药制备方案[P].中国专利:881056078,1983-08-12.

[9]GB/T 16159—1996,汉语拼音正词法基本规则[S].北京:中国标准出版社,1996.

[10]谢希德.创造学习的思路[N].人民日报,1998-12-25(10).

[11]王明亮.中国学术期刊标准化数据库系统工程的[EB/OL].

附录

程序代码

登陆程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormLogin : Form

{

public FormLogin()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

int total = new SQLHelper().login(textBoxusername.Text.Trim(), textBoxpassword.Text.Trim());

if (total > 0)

{

FormMain main = new FormMain();

main.Show();

this.Hide();

}

else

{

MessageBox.Show("用户名或密码错误", "提示");

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

}

主函数程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormMain : Form

{

public FormMain()

{

InitializeComponent();

}

private void 信息录入ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormAddStudent add = new FormAddStudent();

add.ShowDialog();

if (add.DialogResult == DialogResult.OK)

{

bind();

}

}

BindingSource bs = new BindingSource();

public void bind()//刷新网格

{

bs.DataSource = new SQLHelper().CreateTable();

dataGridViewstudent.DataSource = bs;

}

private void FormMain_Load(object sender, EventArgs e)

{

bind();

}

private void 信息删除ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormDeleteStudent delete = new FormDeleteStudent();

delete.ShowDialog();

if (delete.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 查找信息ToolStripMenuItem_Click(object sender, EventArgs e)

下面来看看编写的艰辛历程:在刚开始的阶段,我经常因为单词的拼错出现这样或那样的错误在数次的错误后我吸取教训在后来的编程中几乎不出现了这种错误。剩下的错误就是引用或语法上的错误。感到最深刻的是,窗体name后就不能随意更改了,更改后在编写的程序的程序中要相应的更新里面的内容。当出现语法错误时我因经验的不足不足很难自己将其更改出来,但通过在网上查询几乎都能找到我想要的结果。成功后留下的就是经验和成就感了,在经验和成就感的陪伴下我充满着信心、激情和执着。期间还有很多老师和同学的帮助。从中感受到了互动的优势和群众的力量。

第六章结束语

为期九周的课程设计结束了,在王老师辛勤代理及同学们的帮助下我逐渐的掌握了一些编程的基本知识!毕竟我完成了教育部给我们规定的任务,期间,总有很多感触。内心充满了感激之情,特别是我们的班主任王老师,在微机房里为我们一遍又一遍的从零点讲起细心教导,在我们编程过程中又一个一个的询问我们的掌握情况。不论遇到什么问题,想想我们的老师,我们总会充满信心。在老师的关怀下我成功了!此时,言语已无法表达我对老师的感激了!此时无声胜有声!

参考文献

[1]王山,萨师煊.高等教育出版社.数据库系统概论.

[2]王磊.实验教程.

[3]袁庆龙,候文义.Ni-P合金镀层组织形貌及显微硬度研究[J].太原理工大学学报,2001,32(1):51-53 .

[4]刘国钧,王连成.图书馆史研究[M].北京:高等教育出版社,1979:15-18,31.

[5]孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22.

[6]张和生.地质力学系统理论[D.太原:太原理工大学,1998.

[7]冯西桥.核反应堆压力容器的LBB分析[R].北京:清华大学核能技术设计研究院,1997.

[8]姜锡洲.一种温热外敷药制备方案[P].中国专利:881056078,1983-08-12.

[9]GB/T 16159—1996,汉语拼音正词法基本规则[S].北京:中国标准出版社,1996.

[10]谢希德.创造学习的思路[N].人民日报,1998-12-25(10).

[11]王明亮.中国学术期刊标准化数据库系统工程的[EB/OL].

附录

程序代码

登陆程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormLogin : Form

{

public FormLogin()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

int total = new SQLHelper().login(textBoxusername.Text.Trim(), textBoxpassword.Text.Trim());

if (total > 0)

{

FormMain main = new FormMain();

main.Show();

this.Hide();

}

else

{

MessageBox.Show("用户名或密码错误", "提示");

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

}

主函数程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormMain : Form

{

public FormMain()

{

InitializeComponent();

}

private void 信息录入ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormAddStudent add = new FormAddStudent();

add.ShowDialog();

if (add.DialogResult == DialogResult.OK)

{

bind();

}

}

BindingSource bs = new BindingSource();

public void bind()//刷新网格

{

bs.DataSource = new SQLHelper().CreateTable();

dataGridViewstudent.DataSource = bs;

}

private void FormMain_Load(object sender, EventArgs e)

{

bind();

}

private void 信息删除ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormDeleteStudent delete = new FormDeleteStudent();

delete.ShowDialog();

if (delete.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 查找信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormRearchStudent search = new FormRearchStudent();

search.ShowDialog();

if (search.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 修改信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormUpdateStudent update = new FormUpdateStudent();

update.ShowDialog();

if (update.DialogResult == DialogResult.OK)

{

bind();

}

}

}

}

添加信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

using System.Data.SqlClient;

namespace StudentMIS

{

public partial class FormAddStudent : Form

[9]GB/T 16159—1996,汉语拼音正词法基本规则[S].北京:中国标准出版社,1996.

[10]谢希德.创造学习的思路[N].人民日报,1998-12-25(10).

[11]王明亮.中国学术期刊标准化数据库系统工程的[EB/OL].

附录

程序代码

登陆程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormLogin : Form

{

public FormLogin()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

int total = new SQLHelper().login(textBoxusername.Text.Trim(), textBoxpassword.Text.Trim());

if (total > 0)

{

FormMain main = new FormMain();

main.Show();

this.Hide();

}

else

{

MessageBox.Show("用户名或密码错误", "提示");

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

}

主函数程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormMain : Form

{

public FormMain()

{

InitializeComponent();

}

private void 信息录入ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormAddStudent add = new FormAddStudent();

add.ShowDialog();

if (add.DialogResult == DialogResult.OK)

{

bind();

}

}

BindingSource bs = new BindingSource();

public void bind()//刷新网格

{

bs.DataSource = new SQLHelper().CreateTable();

dataGridViewstudent.DataSource = bs;

}

private void FormMain_Load(object sender, EventArgs e)

{

bind();

}

private void 信息删除ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormDeleteStudent delete = new FormDeleteStudent();

delete.ShowDialog();

if (delete.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 查找信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormRearchStudent search = new FormRearchStudent();

search.ShowDialog();

if (search.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 修改信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormUpdateStudent update = new FormUpdateStudent();

update.ShowDialog();

if (update.DialogResult == DialogResult.OK)

{

bind();

}

}

}

}

添加信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

using System.Data.SqlClient;

namespace StudentMIS

{

public partial class FormAddStudent : Form

{

public FormAddStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

string sno = textBoxSno.Text.Trim();

string sname = textBoxSname.Text.Trim();

string sex = comboBoxsex.Text.Trim();

string birthday = textBoxbirthday.Text.Trim();

new StudentDAO().insert(sno,sname,sex,birthday);

this.DialogResult = DialogResult.OK;

MessageBox.Show("输入成功");

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxSno.Text = "";

textBoxSname.Text = "";

comboBoxsex.Text = "男";

textBoxbirthday.Text = "";

textBoxSno.Focus();

}

}

else

{

MessageBox.Show("用户名或密码错误", "提示");

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxusername.Text = "";

textBoxpassword.Text = "";

textBoxusername.Focus();

}

}

}

主函数程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormMain : Form

{

public FormMain()

{

InitializeComponent();

}

private void 信息录入ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormAddStudent add = new FormAddStudent();

add.ShowDialog();

if (add.DialogResult == DialogResult.OK)

{

bind();

}

}

BindingSource bs = new BindingSource();

public void bind()//刷新网格

{

bs.DataSource = new SQLHelper().CreateTable();

dataGridViewstudent.DataSource = bs;

}

private void FormMain_Load(object sender, EventArgs e)

{

bind();

}

private void 信息删除ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormDeleteStudent delete = new FormDeleteStudent();

delete.ShowDialog();

if (delete.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 查找信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormRearchStudent search = new FormRearchStudent();

search.ShowDialog();

if (search.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 修改信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormUpdateStudent update = new FormUpdateStudent();

update.ShowDialog();

if (update.DialogResult == DialogResult.OK)

{

bind();

}

}

}

}

添加信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

using System.Data.SqlClient;

namespace StudentMIS

{

public partial class FormAddStudent : Form

{

public FormAddStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

string sno = textBoxSno.Text.Trim();

string sname = textBoxSname.Text.Trim();

string sex = comboBoxsex.Text.Trim();

string birthday = textBoxbirthday.Text.Trim();

new StudentDAO().insert(sno,sname,sex,birthday);

this.DialogResult = DialogResult.OK;

MessageBox.Show("输入成功");

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxSno.Text = "";

textBoxSname.Text = "";

comboBoxsex.Text = "男";

textBoxbirthday.Text = "";

textBoxSno.Focus();

}

}

}

删除信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormDeleteStudent : Form

{

public FormDeleteStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

new StudentDAO().deletebysno(textBoxsno.Text.Trim());

this.DialogResult = DialogResult.OK;

new StudentDAO().deletebyname(textBoxsname.Text.Trim());

MessageBox.Show("删除成功");

this.DialogResult = DialogResult.OK;

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxsno.Text = "";

{

FormAddStudent add = new FormAddStudent();

add.ShowDialog();

if (add.DialogResult == DialogResult.OK)

{

bind();

}

}

BindingSource bs = new BindingSource();

public void bind()//刷新网格

{

bs.DataSource = new SQLHelper().CreateTable();

dataGridViewstudent.DataSource = bs;

}

private void FormMain_Load(object sender, EventArgs e)

{

bind();

}

private void 信息删除ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormDeleteStudent delete = new FormDeleteStudent();

delete.ShowDialog();

if (delete.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 查找信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormRearchStudent search = new FormRearchStudent();

search.ShowDialog();

if (search.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 修改信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormUpdateStudent update = new FormUpdateStudent();

update.ShowDialog();

if (update.DialogResult == DialogResult.OK)

{

bind();

}

}

}

}

添加信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

using System.Data.SqlClient;

namespace StudentMIS

{

public partial class FormAddStudent : Form

{

public FormAddStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

string sno = textBoxSno.Text.Trim();

string sname = textBoxSname.Text.Trim();

string sex = comboBoxsex.Text.Trim();

string birthday = textBoxbirthday.Text.Trim();

new StudentDAO().insert(sno,sname,sex,birthday);

this.DialogResult = DialogResult.OK;

MessageBox.Show("输入成功");

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxSno.Text = "";

textBoxSname.Text = "";

comboBoxsex.Text = "男";

textBoxbirthday.Text = "";

textBoxSno.Focus();

}

}

}

删除信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormDeleteStudent : Form

{

public FormDeleteStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

new StudentDAO().deletebysno(textBoxsno.Text.Trim());

this.DialogResult = DialogResult.OK;

new StudentDAO().deletebyname(textBoxsname.Text.Trim());

MessageBox.Show("删除成功");

this.DialogResult = DialogResult.OK;

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxsno.Text = "";

textBoxsname.Text = "";

textBoxsno.Focus();

}

}

}

查找信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormRearchStudent : Form

{

public FormRearchStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearchbysno_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxsno.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

private void buttonsearchbysname_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysname(textBoxsname.Text.Trim());

{

FormRearchStudent search = new FormRearchStudent();

search.ShowDialog();

if (search.DialogResult == DialogResult.OK)

{

bind();

}

}

private void 修改信息ToolStripMenuItem_Click(object sender, EventArgs e)

{

FormUpdateStudent update = new FormUpdateStudent();

update.ShowDialog();

if (update.DialogResult == DialogResult.OK)

{

bind();

}

}

}

}

添加信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

using System.Data.SqlClient;

namespace StudentMIS

{

public partial class FormAddStudent : Form

{

public FormAddStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

string sno = textBoxSno.Text.Trim();

string sname = textBoxSname.Text.Trim();

string sex = comboBoxsex.Text.Trim();

string birthday = textBoxbirthday.Text.Trim();

new StudentDAO().insert(sno,sname,sex,birthday);

this.DialogResult = DialogResult.OK;

MessageBox.Show("输入成功");

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxSno.Text = "";

textBoxSname.Text = "";

comboBoxsex.Text = "男";

textBoxbirthday.Text = "";

textBoxSno.Focus();

}

}

}

删除信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormDeleteStudent : Form

{

public FormDeleteStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

new StudentDAO().deletebysno(textBoxsno.Text.Trim());

this.DialogResult = DialogResult.OK;

new StudentDAO().deletebyname(textBoxsname.Text.Trim());

MessageBox.Show("删除成功");

this.DialogResult = DialogResult.OK;

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxsno.Text = "";

textBoxsname.Text = "";

textBoxsno.Focus();

}

}

}

查找信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormRearchStudent : Form

{

public FormRearchStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearchbysno_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxsno.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

private void buttonsearchbysname_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysname(textBoxsname.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

}

}

修改信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormUpdateStudent : Form

{

public FormUpdateStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearch_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxSno.Text.Trim());

dataGridView1.DataSource = bs;

}

private void buttonsname_Click(object sender, EventArgs e)

{

if (textBoxSno.Text == "")

{

{

public FormAddStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

string sno = textBoxSno.Text.Trim();

string sname = textBoxSname.Text.Trim();

string sex = comboBoxsex.Text.Trim();

string birthday = textBoxbirthday.Text.Trim();

new StudentDAO().insert(sno,sname,sex,birthday);

this.DialogResult = DialogResult.OK;

MessageBox.Show("输入成功");

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxSno.Text = "";

textBoxSname.Text = "";

comboBoxsex.Text = "男";

textBoxbirthday.Text = "";

textBoxSno.Focus();

}

}

}

删除信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormDeleteStudent : Form

{

public FormDeleteStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

new StudentDAO().deletebysno(textBoxsno.Text.Trim());

this.DialogResult = DialogResult.OK;

new StudentDAO().deletebyname(textBoxsname.Text.Trim());

MessageBox.Show("删除成功");

this.DialogResult = DialogResult.OK;

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxsno.Text = "";

textBoxsname.Text = "";

textBoxsno.Focus();

}

}

}

查找信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormRearchStudent : Form

{

public FormRearchStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearchbysno_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxsno.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

private void buttonsearchbysname_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysname(textBoxsname.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

}

}

修改信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormUpdateStudent : Form

{

public FormUpdateStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearch_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxSno.Text.Trim());

dataGridView1.DataSource = bs;

}

private void buttonsname_Click(object sender, EventArgs e)

{

if (textBoxSno.Text == "")

{

MessageBox.Show("请输入要修改的学号!");

return;

}

else

{

MessageBox.Show("修改成功");

string sno = textBoxSno.Text;

string sname = textBoxSname.Text;

new StudentDAO().update(sno,sname);

MessageBox.Show("修改成功");

this.DialogResult = DialogResult.OK;

}

}

}

}

StudentDAO

using System;

using System.Collections.Generic;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Text;

namespace DataAccessLayer

{

public class StudentDAO// : DataAccessLayer.IStudentDAO

{

private SQLHelper sqlhelper = null;

public StudentDAO()

{

sqlhelper = new SQLHelper();

}

//增

public void insert(string sno, string sname, string sex, string birthday)

}

删除信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormDeleteStudent : Form

{

public FormDeleteStudent()

{

InitializeComponent();

}

private void buttonok_Click(object sender, EventArgs e)

{

new StudentDAO().deletebysno(textBoxsno.Text.Trim());

this.DialogResult = DialogResult.OK;

new StudentDAO().deletebyname(textBoxsname.Text.Trim());

MessageBox.Show("删除成功");

this.DialogResult = DialogResult.OK;

}

private void buttoncancel_Click(object sender, EventArgs e)

{

textBoxsno.Text = "";

textBoxsname.Text = "";

textBoxsno.Focus();

}

}

}

查找信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormRearchStudent : Form

{

public FormRearchStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearchbysno_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxsno.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

private void buttonsearchbysname_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysname(textBoxsname.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

}

}

修改信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormUpdateStudent : Form

{

public FormUpdateStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearch_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxSno.Text.Trim());

dataGridView1.DataSource = bs;

}

private void buttonsname_Click(object sender, EventArgs e)

{

if (textBoxSno.Text == "")

{

MessageBox.Show("请输入要修改的学号!");

return;

}

else

{

MessageBox.Show("修改成功");

string sno = textBoxSno.Text;

string sname = textBoxSname.Text;

new StudentDAO().update(sno,sname);

MessageBox.Show("修改成功");

this.DialogResult = DialogResult.OK;

}

}

}

}

StudentDAO

using System;

using System.Collections.Generic;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Text;

namespace DataAccessLayer

{

public class StudentDAO// : DataAccessLayer.IStudentDAO

{

private SQLHelper sqlhelper = null;

public StudentDAO()

{

sqlhelper = new SQLHelper();

}

//增

public void insert(string sno, string sname, string sex, string birthday)

{

string sql = "insert into student values(@sno,@sname,@sex,@birthday)";

SqlParameter[] para = new SqlParameter[] {

new SqlParameter("sno",SqlDbType.NChar),

new SqlParameter("sname",SqlDbType.NVarChar),

new SqlParameter("sex",SqlDbType.NChar),

new SqlParameter("birthday",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

para[i++].Value = sex;

para[i++].Value = birthday;

sqlhelper.ExecuteNonQuery(sql, para);

}

//删

public void deletebysno(string sno)

{

string sql = "delete from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

textBoxsname.Text = "";

textBoxsno.Focus();

}

}

}

查找信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormRearchStudent : Form

{

public FormRearchStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearchbysno_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxsno.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

private void buttonsearchbysname_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysname(textBoxsname.Text.Trim());

dataGridViewstudent.DataSource = bs;

}

}

}

修改信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormUpdateStudent : Form

{

public FormUpdateStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearch_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxSno.Text.Trim());

dataGridView1.DataSource = bs;

}

private void buttonsname_Click(object sender, EventArgs e)

{

if (textBoxSno.Text == "")

{

MessageBox.Show("请输入要修改的学号!");

return;

}

else

{

MessageBox.Show("修改成功");

string sno = textBoxSno.Text;

string sname = textBoxSname.Text;

new StudentDAO().update(sno,sname);

MessageBox.Show("修改成功");

this.DialogResult = DialogResult.OK;

}

}

}

}

StudentDAO

using System;

using System.Collections.Generic;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Text;

namespace DataAccessLayer

{

public class StudentDAO// : DataAccessLayer.IStudentDAO

{

private SQLHelper sqlhelper = null;

public StudentDAO()

{

sqlhelper = new SQLHelper();

}

//增

public void insert(string sno, string sname, string sex, string birthday)

{

string sql = "insert into student values(@sno,@sname,@sex,@birthday)";

SqlParameter[] para = new SqlParameter[] {

new SqlParameter("sno",SqlDbType.NChar),

new SqlParameter("sname",SqlDbType.NVarChar),

new SqlParameter("sex",SqlDbType.NChar),

new SqlParameter("birthday",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

para[i++].Value = sex;

para[i++].Value = birthday;

sqlhelper.ExecuteNonQuery(sql, para);

}

//删

public void deletebysno(string sno)

{

string sql = "delete from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

sqlhelper.ExecuteNonQuery(sql, para);

}

public void deletebyname(string sname)

{

string sql = "delete from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql,para);

}

//查找

public DataTable searchbysno(string sno)

{

DataTable table = new DataTable();

string sql = "select * from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

dataGridViewstudent.DataSource = bs;

}

}

}

修改信息程序代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using DataAccessLayer;

namespace StudentMIS

{

public partial class FormUpdateStudent : Form

{

public FormUpdateStudent()

{

InitializeComponent();

}

BindingSource bs = new BindingSource();

private void buttonsearch_Click(object sender, EventArgs e)

{

bs.DataSource = new StudentDAO().searchbysno(textBoxSno.Text.Trim());

dataGridView1.DataSource = bs;

}

private void buttonsname_Click(object sender, EventArgs e)

{

if (textBoxSno.Text == "")

{

MessageBox.Show("请输入要修改的学号!");

return;

}

else

{

MessageBox.Show("修改成功");

string sno = textBoxSno.Text;

string sname = textBoxSname.Text;

new StudentDAO().update(sno,sname);

MessageBox.Show("修改成功");

this.DialogResult = DialogResult.OK;

}

}

}

}

StudentDAO

using System;

using System.Collections.Generic;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Text;

namespace DataAccessLayer

{

public class StudentDAO// : DataAccessLayer.IStudentDAO

{

private SQLHelper sqlhelper = null;

public StudentDAO()

{

sqlhelper = new SQLHelper();

}

//增

public void insert(string sno, string sname, string sex, string birthday)

{

string sql = "insert into student values(@sno,@sname,@sex,@birthday)";

SqlParameter[] para = new SqlParameter[] {

new SqlParameter("sno",SqlDbType.NChar),

new SqlParameter("sname",SqlDbType.NVarChar),

new SqlParameter("sex",SqlDbType.NChar),

new SqlParameter("birthday",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

para[i++].Value = sex;

para[i++].Value = birthday;

sqlhelper.ExecuteNonQuery(sql, para);

}

//删

public void deletebysno(string sno)

{

string sql = "delete from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

sqlhelper.ExecuteNonQuery(sql, para);

}

public void deletebyname(string sname)

{

string sql = "delete from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql,para);

}

//查找

public DataTable searchbysno(string sno)

{

DataTable table = new DataTable();

string sql = "select * from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

table = sqlhelper.CreateTableBySno(sql, para);

return table;

}

public DataTable searchbysname(string sname)

{

DataTable table = new DataTable();

string sql = "select * from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sname;

table = sqlhelper.CreateTableBySname(sql, para);

return table;

}

//修改

public void update(string sno, string sname)

{

DataTable table = new DataTable();

MessageBox.Show("请输入要修改的学号!");

return;

}

else

{

MessageBox.Show("修改成功");

string sno = textBoxSno.Text;

string sname = textBoxSname.Text;

new StudentDAO().update(sno,sname);

MessageBox.Show("修改成功");

this.DialogResult = DialogResult.OK;

}

}

}

}

StudentDAO

using System;

using System.Collections.Generic;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Text;

namespace DataAccessLayer

{

public class StudentDAO// : DataAccessLayer.IStudentDAO

{

private SQLHelper sqlhelper = null;

public StudentDAO()

{

sqlhelper = new SQLHelper();

}

//增

public void insert(string sno, string sname, string sex, string birthday)

{

string sql = "insert into student values(@sno,@sname,@sex,@birthday)";

SqlParameter[] para = new SqlParameter[] {

new SqlParameter("sno",SqlDbType.NChar),

new SqlParameter("sname",SqlDbType.NVarChar),

new SqlParameter("sex",SqlDbType.NChar),

new SqlParameter("birthday",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

para[i++].Value = sex;

para[i++].Value = birthday;

sqlhelper.ExecuteNonQuery(sql, para);

}

//删

public void deletebysno(string sno)

{

string sql = "delete from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

sqlhelper.ExecuteNonQuery(sql, para);

}

public void deletebyname(string sname)

{

string sql = "delete from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql,para);

}

//查找

public DataTable searchbysno(string sno)

{

DataTable table = new DataTable();

string sql = "select * from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

table = sqlhelper.CreateTableBySno(sql, para);

return table;

}

public DataTable searchbysname(string sname)

{

DataTable table = new DataTable();

string sql = "select * from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sname;

table = sqlhelper.CreateTableBySname(sql, para);

return table;

}

//修改

public void update(string sno, string sname)

{

DataTable table = new DataTable();

string sql = " update student set @sname='sname' where @sno='sno' ";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NVarChar),

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql, para);

}

}

}

SQLHelper

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data.SqlClient;

using System.Data;

namespace DataAccessLayer

{

public class SQLHelper

{

public void ExecuteNonQuery(string sql, params SqlParameter[] para)

{

string connstr = @"server=.\;database=student;integrated security=sspi";

{

string sql = "insert into student values(@sno,@sname,@sex,@birthday)";

SqlParameter[] para = new SqlParameter[] {

new SqlParameter("sno",SqlDbType.NChar),

new SqlParameter("sname",SqlDbType.NVarChar),

new SqlParameter("sex",SqlDbType.NChar),

new SqlParameter("birthday",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

para[i++].Value = sex;

para[i++].Value = birthday;

sqlhelper.ExecuteNonQuery(sql, para);

}

//删

public void deletebysno(string sno)

{

string sql = "delete from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

sqlhelper.ExecuteNonQuery(sql, para);

}

public void deletebyname(string sname)

{

string sql = "delete from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql,para);

}

//查找

public DataTable searchbysno(string sno)

{

DataTable table = new DataTable();

string sql = "select * from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

table = sqlhelper.CreateTableBySno(sql, para);

return table;

}

public DataTable searchbysname(string sname)

{

DataTable table = new DataTable();

string sql = "select * from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sname;

table = sqlhelper.CreateTableBySname(sql, para);

return table;

}

//修改

public void update(string sno, string sname)

{

DataTable table = new DataTable();

string sql = " update student set @sname='sname' where @sno='sno' ";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NVarChar),

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql, para);

}

}

}

SQLHelper

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data.SqlClient;

using System.Data;

namespace DataAccessLayer

{

public class SQLHelper

{

public void ExecuteNonQuery(string sql, params SqlParameter[] para)

{

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = new SqlCommand(sql, conn))

{

cmd.Parameters.AddRange(para);

cmd.ExecuteNonQuery();

}

}

}

public DataTable CreateTable()

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

string sql = "select * from student";

using (SqlDataAdapter adapter = new SqlDataAdapter(sql, conn))

{

adapter.Fill(table);

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

sqlhelper.ExecuteNonQuery(sql, para);

}

public void deletebyname(string sname)

{

string sql = "delete from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql,para);

}

//查找

public DataTable searchbysno(string sno)

{

DataTable table = new DataTable();

string sql = "select * from student where sno=@sno";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

table = sqlhelper.CreateTableBySno(sql, para);

return table;

}

public DataTable searchbysname(string sname)

{

DataTable table = new DataTable();

string sql = "select * from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sname;

table = sqlhelper.CreateTableBySname(sql, para);

return table;

}

//修改

public void update(string sno, string sname)

{

DataTable table = new DataTable();

string sql = " update student set @sname='sname' where @sno='sno' ";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NVarChar),

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql, para);

}

}

}

SQLHelper

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data.SqlClient;

using System.Data;

namespace DataAccessLayer

{

public class SQLHelper

{

public void ExecuteNonQuery(string sql, params SqlParameter[] para)

{

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = new SqlCommand(sql, conn))

{

cmd.Parameters.AddRange(para);

cmd.ExecuteNonQuery();

}

}

}

public DataTable CreateTable()

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

string sql = "select * from student";

using (SqlDataAdapter adapter = new SqlDataAdapter(sql, conn))

{

adapter.Fill(table);

}

}

return table;

}

public DataTable CreateTableBySno(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public DataTable CreateTableBySname(string sql, params SqlParameter[] para)

{

new SqlParameter("sno",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sno;

table = sqlhelper.CreateTableBySno(sql, para);

return table;

}

public DataTable searchbysname(string sname)

{

DataTable table = new DataTable();

string sql = "select * from student where sname=@sname";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sname",SqlDbType.NChar)

};

int i = 0;

para[i++].Value = sname;

table = sqlhelper.CreateTableBySname(sql, para);

return table;

}

//修改

public void update(string sno, string sname)

{

DataTable table = new DataTable();

string sql = " update student set @sname='sname' where @sno='sno' ";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NVarChar),

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql, para);

}

}

}

SQLHelper

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data.SqlClient;

using System.Data;

namespace DataAccessLayer

{

public class SQLHelper

{

public void ExecuteNonQuery(string sql, params SqlParameter[] para)

{

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = new SqlCommand(sql, conn))

{

cmd.Parameters.AddRange(para);

cmd.ExecuteNonQuery();

}

}

}

public DataTable CreateTable()

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

string sql = "select * from student";

using (SqlDataAdapter adapter = new SqlDataAdapter(sql, conn))

{

adapter.Fill(table);

}

}

return table;

}

public DataTable CreateTableBySno(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public DataTable CreateTableBySname(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public int login(string uname, string pwd)

{

//判断用户输入的用户名和密码是否与从后台数据库中取出的是否一致。

//若一致,则可以登陆,不一致,不允许登陆

string connstr = @"server=.\;database=studentlogin;integrated security=sspi";

string sql = " update student set @sname='sname' where @sno='sno' ";

SqlParameter[] para = new SqlParameter[]

{

new SqlParameter("sno",SqlDbType.NVarChar),

new SqlParameter("sname",SqlDbType.NVarChar)

};

int i = 0;

para[i++].Value = sno;

para[i++].Value = sname;

sqlhelper.ExecuteNonQuery(sql, para);

}

}

}

SQLHelper

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data.SqlClient;

using System.Data;

namespace DataAccessLayer

{

public class SQLHelper

{

public void ExecuteNonQuery(string sql, params SqlParameter[] para)

{

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = new SqlCommand(sql, conn))

{

cmd.Parameters.AddRange(para);

cmd.ExecuteNonQuery();

}

}

}

public DataTable CreateTable()

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

string sql = "select * from student";

using (SqlDataAdapter adapter = new SqlDataAdapter(sql, conn))

{

adapter.Fill(table);

}

}

return table;

}

public DataTable CreateTableBySno(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public DataTable CreateTableBySname(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public int login(string uname, string pwd)

{

//判断用户输入的用户名和密码是否与从后台数据库中取出的是否一致。

//若一致,则可以登陆,不一致,不允许登陆

string connstr = @"server=.\;database=studentlogin;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = "select count(*)from t_login where username=@username and password=@password";

cmd.Parameters.Add(new SqlParameter("username", uname));

cmd.Parameters.Add(new SqlParameter("password", pwd));

int total = Convert.ToInt32(cmd.ExecuteScalar());//返回查询值得首行首列,返回值类型

//不确定,是object类型。

return total;

}

}

}

}

}

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = new SqlCommand(sql, conn))

{

cmd.Parameters.AddRange(para);

cmd.ExecuteNonQuery();

}

}

}

public DataTable CreateTable()

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

string sql = "select * from student";

using (SqlDataAdapter adapter = new SqlDataAdapter(sql, conn))

{

adapter.Fill(table);

}

}

return table;

}

public DataTable CreateTableBySno(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public DataTable CreateTableBySname(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public int login(string uname, string pwd)

{

//判断用户输入的用户名和密码是否与从后台数据库中取出的是否一致。

//若一致,则可以登陆,不一致,不允许登陆

string connstr = @"server=.\;database=studentlogin;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = "select count(*)from t_login where username=@username and password=@password";

cmd.Parameters.Add(new SqlParameter("username", uname));

cmd.Parameters.Add(new SqlParameter("password", pwd));

int total = Convert.ToInt32(cmd.ExecuteScalar());//返回查询值得首行首列,返回值类型

//不确定,是object类型。

return total;

}

}

}

}

}

}

}

return table;

}

public DataTable CreateTableBySno(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public DataTable CreateTableBySname(string sql, params SqlParameter[] para)

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public int login(string uname, string pwd)

{

//判断用户输入的用户名和密码是否与从后台数据库中取出的是否一致。

//若一致,则可以登陆,不一致,不允许登陆

string connstr = @"server=.\;database=studentlogin;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = "select count(*)from t_login where username=@username and password=@password";

cmd.Parameters.Add(new SqlParameter("username", uname));

cmd.Parameters.Add(new SqlParameter("password", pwd));

int total = Convert.ToInt32(cmd.ExecuteScalar());//返回查询值得首行首列,返回值类型

//不确定,是object类型。

return total;

}

}

}

}

}

{

DataTable table = new DataTable();

string connstr = @"server=.\;database=student;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = sql;

cmd.Parameters.AddRange(para);

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

{

adapter.Fill(table);

}

}

}

return table;

}

public int login(string uname, string pwd)

{

//判断用户输入的用户名和密码是否与从后台数据库中取出的是否一致。

//若一致,则可以登陆,不一致,不允许登陆

string connstr = @"server=.\;database=studentlogin;integrated security=sspi";

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = "select count(*)from t_login where username=@username and password=@password";

cmd.Parameters.Add(new SqlParameter("username", uname));

cmd.Parameters.Add(new SqlParameter("password", pwd));

int total = Convert.ToInt32(cmd.ExecuteScalar());//返回查询值得首行首列,返回值类型

//不确定,是object类型。

return total;

}

}

}

}

}

using (SqlConnection conn = new SqlConnection(connstr))

{

conn.Open();

using (SqlCommand cmd = conn.CreateCommand())

{

cmd.CommandText = "select count(*)from t_login where username=@username and password=@password";

cmd.Parameters.Add(new SqlParameter("username", uname));

cmd.Parameters.Add(new SqlParameter("password", pwd));

int total = Convert.ToInt32(cmd.ExecuteScalar());//返回查询值得首行首列,返回值类型

//不确定,是object类型。

return total;

}

}

}

}

}

学生成绩管理系统课程设计[精选]学生成绩管理系统课程设计[范文]学生成绩管理系统课程设计大全就在精品文库网毕业实训报告毕业设计题目:学生成绩管理系统学生姓名:所在学院:信息工程学院专业及班级:指导教师:完成日期:2014年1月10日目录1.选题的目的和意义-------------------------------------11.1项目开发的背景---------------------------------11.2项目概述---------------------------------------11.3设计目的与意义---------------------------------12系统的开发技术及主要架构-----------------------------12.1开发技术的选择---------------------------------12.2项目开发的工具--


猜你想看
相关文章

Copyright © 2008 - 2022 版权所有 职场范文网

工业和信息化部 备案号:沪ICP备18009755号-3