ImageVerifierCode 换一换
格式:DOCX , 页数:29 ,大小:137.83KB ,
资源ID:20770333      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/20770333.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(数据库应用系统的开发Word文档格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

数据库应用系统的开发Word文档格式.docx

1、护界面、教师信息维护界面、课程信息维护界面。当用户名的类型为教师的时候,进入的是教师输入成绩的界面,该界面可以查找本教师所教的课程,并且修改所选该课程的学生的成绩。当用户名的类型为学生的时候,进入的是学生选课的界面,该界面学生可以选课并且可以退课,并且可以查询该学生所选的课程。各界面的关系如下图: 本系统涉及的主要数据的E-R图4、系统详细设计及数据库表结构设计(一). 数据库表结构设计设计五张表:Admin表CREATE table admin(adminid char(9) primary key,adminname char(20) unique,adminpas char(10);St

2、udent表CREATE table student(学号char(9) primary key,姓名char(20) unique,性别char(2),出生时间datetime,所在系char(20),班级char(3),密码char(10);Teacher表CREATE table teacher(教师号 char(9) primary key,教师名 char(20) unique,所在系 char(20),密码 char(10);Course表CREATE table course(课程号 char(4) primary key,课程名 char(40) ,教师号 char(9),学分

3、 float(53) ,课程简介 text,foreign key (教师号) references teacher(教师号);Score表CREATE table score( 学号 char(9) ,课程号 char(4) ,成绩 smallint,primary key(学号,课程号),foreign key (学号) references student(学号),foreign key (课程号) references course(课程号);数据库关系图如下:(二).登陆界面的设计:1首先打开Visual Studio 2008。2新建一个工程,工程名为:Login3在窗体上放置Bu

4、tton组件Button1、Button2,Label组件Label1、Label2,TextBox组件TextBox1、TextBox2,RadioButton组件RadioButton1、RadioButton2、RadioButton3,GroupBox组件GroupBox1。4设置Button组件的name属性:Button1和Button2的name的属性分别为:btQueding、btQuxiao。5设置Button组件的Text属性:Button1和Button2的Text的属性分别为:确定和取消。6设置Label组件的name属性:Label1和Label2的name的属性分别

5、为:lbName,lbPas。7设置Label组件的Text属性:Label1和Label2的Text的属性分别为:学号和密码。8设置TextBox组件的name属性:TextBox1和TextBox2的name的属性分别为:tbName和tbPas。9设置GroupBox的name属性:GroupBox的Text的属性为:登陆类型。10设置RadioButton的name属性:RadioButton1、RadioButton2、RadioButton3的name的属性分别为:rbAdmin、rbStudent、rbTeacher。11设置RadioButton的Text属性:RadioBut

6、ton1、RadioButton2、RadioButton3的Text的属性分别为:管理员、学生、教师。12设置RadioButton的checked的属性改为True。13双击取消按钮:输入以下代码:close();14双击确定按钮:string LJ = server=.;database=myd;uid=sa;pwd=; /建立连接 SqlConnection conn = new SqlConnection(LJ); conn.Open(); /读取所输入的用户名和密码 SqlCommand comm = conn.CreateCommand(); if (rbAdmin.Checke

7、d) string sql = SELECT adminname,adminpas FROM admin WHERE(adminname= + tbName.Text + ) comm.CommandText = sql; SqlDataReader datar = comm.ExecuteReader(); DateTime dt = new DateTime(2008, 1, 1); if (DateTime.Now = dt) MessageBox.Show(程序已经过期,请联系开发商!, 系统提示:, MessageBoxButtons.OK, MessageBoxIcon.Infor

8、mation); Close(); /判断是否存在输入的用户 else if (!datar.HasRows)用户名不存在,请重新输入!); tbName.Focus(); return; /读取数据库的内容,并与输入的进行比较; while (datar.Read() /判断用户输入是否正确 if (dataradminpas.ToString().Trim() != tbPas.Text.Trim()用户密码不正确,请重新输入! tbPas.Focus(); AdminLogin f2 = new AdminLogin(); f2.ShowDialog(); else if (rbStud

9、ent.Checked) string sql = SELECT sno,spas FROM student WHERE(sno=spas StudentLogin f3 = new StudentLogin(); f3.ShowDialog(); else SELECT tno,tpas FROM teacher WHERE(tno=tpas TeacherLogin f4 = new TeacherLogin(); f4.ShowDialog();完成后的界面效果如下图所示.管理员登陆界面设计:AdminLogin3在窗体上放置MenuStrip组件4在MenuStrip上设置三个菜单,菜

10、单的name属性分别为:学生信息维护、教师信息维护、课程信息维护。5双击学生信息维护输入以下代码:StudentInfo si = new StudentInfo(); si.ShowDialog();6双击教师信息维护输入以下代码: TeacherInfo ti = new TeacherInfo(); ti.ShowDialog();7双击课程信息维护输入以下代码: CourseInfo ci = new CourseInfo(); ci.ShowDialog();.学生信息维护界面:StudentInfo3在新建的项目StudentInfo中添加一个名为SqlHelper.cs的类,并打

11、开此类,找到public static string CONNSTR = Data Source=.;Initial Catalog=myd;User ID=sa;Password=并修改。4在窗体上放置数据显示工具DataGridView。5设置DataGridView任务,在选择数据源中,选择添加项目数据源,根据数据源配置向导来添加,和数据库名为myd中的学生 表连接起来,添加成功时,选择数据源为studentBindingSource。6在窗体上放置GroupBox组件GroupBox1,RadioButton组件RadioButton1、RadioButton2、RadioButton

12、3,Label组件Label1、Label2、Label3、Label4、Label5、Label6,Button组件Button1、Button2、Button3,TextBox组件TextBox1到TextBox77设置GroupBox的属性中的Text:GroupBox1的Text中输入:查询条件。8设置Button的属性中的Text:Button1到Button5的Text中分别输入:确认、返回、新增、存盘、删除。9设置Button的属性中的Name:确认、返回、新增、存盘、删除的Name中分别输入:btnOK、btnCancel、butNew、btnSave、butDel。10设置L

13、abel的属性中的Text:Label1到Label6的Text中分别输入:学号、姓名、所在系、性别、出生日期、密码。11设置RadioButton的属性中的Name:RadioButton1到RadioButton3的Name中分别输入:rbXh、rbXm、rbSzx。12设置RadioButton的属性中的Text:RadioButton1到RadioButton3的Text中分别输入:学号、姓名、所在系。13设置RadioButton1的属性中的checked设置为True。14设置TextBox的属性中的Name:TextBox1到TextBox7的Name中分别输入:tbSearch

14、、tbXh、tbXm、tbSzx、tbXb、tbCsrq、tbMm。15分别双击确认、返回、新增、存盘、删除切换到代码窗口,输入代码,代码如下: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 myd public partial class Student

15、Info : Form public StudentInfo() InitializeComponent(); private bool Insert_flag = false; private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) Insert_flag = false; private void StudentInfo_Load(object sender, EventArgs e) / TODO: 这行代码将数据加载到表“mydDataSet1.student”中。您可以根据需要移

16、动或移除它。 this.studentTableAdapter.Fill(this.mydDataSet1.student); private void btnOK_Click(object sender, EventArgs e) if (tbSearch.Text.Length = 0)查询条件不能为空系统提示: int i; if (rbXh.Checked & int.TryParse(tbSearch.Text, out i)学号必需为数字 SqlConnection cnn = new SqlConnection ( SqlCommand cmd = new SqlCommand(

17、); cmd.CommandText = Student_Info_Search cmd.Parameters.Add(SearchType, SqlDbType.Decimal);SearchText, SqlDbType.VarChar, 50); if (rbXh.Checked) i = 0; else if (rbXm.Checked) i = 1; i = 2; cmd.Parameters.Value = i;.Value = tbSearch.Text.Trim(); cmd.CommandType = CommandType.StoredProcedure; cmd.Conn

18、ection = cnn; SqlDataAdapter sda = new SqlDataAdapter(cmd); try DataSet ds = new DataSet(); sda.Fill(ds);/填充数据集 studentBindingSource.DataSource = ds.Tables0; /将数据集显示出来 /把查询出来的数据绑定到相关控件 tbXh.DataBindings.Clear(); tbXm.DataBindings.Clear(); tbSzx.DataBindings.Clear(); tbXb.DataBindings.Clear(); tbCsrq

19、.DataBindings.Clear(); tbMm.DataBindings.Clear(); tbXh.DataBindings.Add(Text, studentBindingSource, sno tbXm.DataBindings.Add(,studentBindingSource, sname tbSzx.DataBindings.Add(sdept tbXb.DataBindings.Add(ssex tbCsrq.DataBindings.Add(sdate tbMm.DataBindings.Add( if (ds.Tables0.Rows.Count Insert_fla

20、g = true; catch (Exception ex)出现错误,错误原因为 + ex.Message, , MessageBoxButtons.OK, MessageBoxIcon.Error); private void btnCancel_Click(object sender, EventArgs e) private void butNew_Click(object sender, EventArgs e) tbXh.Text = tbXm.Text = tbSzx.Text = tbXb.Text = tbCsrq.Text = tbMm.Text = private void

21、 btnSave_Click(object sender, EventArgs e) string sql; if (Insert_flag) sql = Insert into student(sno,sname,sdept,ssex,sdate,spas) values( + tbXh.Text + , + tbXm.Text + + tbSzx.Text + + tbXb.Text + + tbCsrq.Text + + tbMm.Text + update student set sno=,sname=,sdept=,ssex=,sdate=,spas= where CID= + (DataRowView)studentBindingSource.Current)CID.ToString(); SqlCommand cmd = new SqlCommand(sql, cnn); cnn.Open();/打开连接 cmd.ExecuteNonQu

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1