c#+sql学生成绩管理系统完整版

上传人:第*** 文档编号:34252194 上传时间:2018-02-22 格式:DOC 页数:24 大小:438.62KB
返回 下载 相关 举报
c#+sql学生成绩管理系统完整版_第1页
第1页 / 共24页
c#+sql学生成绩管理系统完整版_第2页
第2页 / 共24页
c#+sql学生成绩管理系统完整版_第3页
第3页 / 共24页
c#+sql学生成绩管理系统完整版_第4页
第4页 / 共24页
c#+sql学生成绩管理系统完整版_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《c#+sql学生成绩管理系统完整版》由会员分享,可在线阅读,更多相关《c#+sql学生成绩管理系统完整版(24页珍藏版)》请在金锄头文库上搜索。

1、学 生 成 绩 管 理 系 统姓 名 : 冼 振 强 学 号 : 201130690224摘 要随 着 信 息 技 术 在 管 理 上 越 来 越 深 入 而 广 泛 的 应 用 , 管 理 信 息 系 统 的 实 施 在 技术 上 已 逐 步 成 熟 。 管 理 信 息 系 统 是 一 个 不 断 发 展 的 新 型 学 科 , 任 何 一 个 单 位 要 生存 要 发 展 , 要 高 效 率 地 把 内 部 活 动 有 机 地 组 织 起 来 , 就 必 须 建 立 与 自 身 特 点 相 适应 的 管 理 信 息 系 统 。本 系 统 是 在 管 理 信 息 系 统 的 理 论 和 方

2、法 指 导 下 、 数 据 库 技 术 支 持 下 完 成 的 。本 文 在 结 构 上 首 先 论 述 了 程 序 设 计 目 的 和 意 义 , 然 后 叙 述 了 开 发 环 境 、 开 发 平 台以 及 数 据 库 技 术 , 接 着 用 图 片 、 说 明 和 代 码 的 方 式 介 绍 了 系 统 的 整 体 规 划 , 接 下来 是 系 统 在 具 体 实 现 中 的 详 细 内 容 , 最 终 本 系 统 能 够 完 成 信 息 的 添 加 、 修 改 、 删除 、 查 询 等 功 能 , 本 系 统 界 面 友 好 , 操 作 简 单 , 比 较 实 用 , 思 路 缜 密

3、严 谨 , 管理 起 来 方 便 快 捷 , 能 有 效 的 达 到 学 生 信 息 的 管 理 的 目 的 。012数据库的设计1.1 系统功能流程图添加删除退出所有成绩查找修改升序排序修改密码退出图 3.1 系统功能流程学生成绩管理系统 教师管理系统 登录管理员系统学生成绩管理系统用户登录各科成绩详细信息修改密码学生老师学生老师学生成绩管理系统退出31.2 数据库设计本 系 统 的 数 据 库 是 SQL server 数 据 库 , 在 SQL 环 境 下 创 建 数 据 库 学 生 成 绩管 理 系 统 .mdf 文 件 。 该 数 据 库 包 括 学 生 成 绩 表 、 用 户 登

4、录 表 用 于 纪 录 学 生 的 基本 信 息 数 据 库 表 结 构 如 下 所 示 :1.2.1 各表的物理结构表 3.2.1 学生成绩表表 3.2.2 用户登录表41.2.2 数据库连接代码private void button1_Click(object sender, EventArgs e)string connStr = Server=.;DataBase=LOCAL;Integrated Security=True; /数据库连接字符串,.表示本机服务器DataBase为表名,Integrated Security=True是采用windows身份验证方式登录SqlConne

5、ction conn = new SqlConnection(connStr); /根据连接字符串,新建数据库连接string sqlStr = select * from student1; /查询student1表的查询语句SqlCommand cmd = new SqlCommand(sqlStr, conn); /根据查询语句和数据库连接,等到查询命令对象SqlDataReader reader = cmd.ExecuteReader();/从查询命令对象中获得一个读取数据库数据的对象while (reader.Read() /循环读取下一行数据,如果下一行没有数据返回falsestr

6、ing id = readerid.ToString();/根据列名获得数据string name = readername.ToString();string sex = readersex.ToString();MessageBox.Show(string.Format(id=0,name=1,sex=2, id, name, sex);5主要内容设计过程:用 于 输 入 用 户 名 和 密 码 登 录 , 选 择 相 应 的 用 户 类 型 进 入 系 统 , 若 是 用 户 类 型选 择 错 误 则 不 能 进 入 系 统 。 输 入 用 户 名 和 密 码 后 点 击 确 定 判 断

7、 数 据 库 中 的 用 户 是否 为 合 法 用 户 。设计代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 学生成绩管理系统public partial class Login : Formstatic public string sn,sub;p

8、ublic Login()InitializeComponent();Form2 fr2 = new Form2(); Form3 fr3 = new Form3(); Form4 fr4 = new Form4();/创建新窗体private void Login_Load(object sender, EventArgs e)timer1.Start(); / Timer控件private void btnlogin_Click(object sender, EventArgs e)/Password=123456789;Persist Security Info=True;User ID

9、=sa;Initial Catalog=学生成绩管理系统;Data Source=FLQ-PCSQLEXPRESS/ string str = Password=123456789;Persist Security Info=True;User ID=sa;Initial Catalog=学生成绩管理系统;Data Source=FLQ-PCSQLEXPRESS;string str = Password=123456789;Persist Security Info=True;User ID=sa;Initial Catalog=学生成绩管理系统;Data Source=FLQ-PCSQLE

10、XPRESS;SqlConnection conn = new SqlConnection(str);/6连接数据库conn.Open();if( txtname .Text=|txtpassword .Text=)MessageBox.Show (请不要遗漏信息!);if (rbtnmanager.Checked)string cstr=select * from 用户登录 where 类别=管理员and 用户名=+txtname.Text.Trim ()+and 密码=+txtpassword .Text.Trim ()+;SqlCommand comm=new SqlCommand (c

11、str,conn );SqlDataReader dr=comm.ExecuteReader ();if (dr.Read() sn = txtname.Text.Trim(); fr4.Show(); this.Visible = false; elseMessageBox.Show(输入有误,请重新输入!);txtname.Text = ; txtpassword.Text = ;if (rbtnteacher.Checked)string cstr = select * from 用户登录 where 类别=教师and 用户名= + txtname.Text.Trim() + and 密

12、码= + txtpassword.Text.Trim() + ;SqlCommand comm = new SqlCommand(cstr, conn);SqlDataReader dr = comm.ExecuteReader();if (dr.Read() sn = txtname.Text.Trim(); sub = dr.GetValue(3).ToString (); fr3.Show(); this.Visible = false; elseMessageBox.Show(输入有误,请重新输入!);txtname.Text = ; txtpassword.Text = ;if (r

13、btnstudent.Checked)string cstr = select * from 用户登录 where 类别=学生and 用户名= + txtname.Text.Trim() + and 密码= + txtpassword.Text.Trim() + ;SqlCommand comm = new SqlCommand(cstr, conn);SqlDataReader dr = comm.ExecuteReader();if (dr.Read() sn = txtname.Text.Trim();fr2.Show(); this.Visible=false ; else Messa

14、geBox.Show(输入有误,请重新输入!);txtname.Text = ; txtpassword.Text = ;7conn.Close(); conn.Dispose();private void button2_Click(object sender, EventArgs e)Application.Exit();private void timer1_Tick(object sender, EventArgs e)label1.Text = 当前时间为: +DateTime.Now .ToLongDateString() + +DateTime.Now.ToLongTimeStr

15、ing();82 学生成绩管理界面图 4.2 学生成绩管理界面设计过程:此 部 分 主 要 针 对 学 生 信 息 的 管 理 , 可 以 查 询 学 生 的 所 有 成 绩 信 息 , 实 现 成 绩的 添 加 、 删 除 、 修 改 、 计 算 平 均 分 等 功 能 。 还 可 以 修 改 当 前 用 户 下 的 密 码 。设计代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 学生成绩管理系统public partial class Form2 : Formpublic Form2()InitializeComponent

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号