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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

图书管理系统数据库实验报告.docx

1、图书管理系统数据库实验报告科 技 学 院课程设计报告( 2013- 2014年度第2学期)名 称: 数据库原理课程设计 院 系: 信息工程系 班 级: 学 号: 学生姓名: 指导教师: 郭丰娟 王晓辉 设计周数: 1 成 绩: 日期:2014年 5 月29日数据库原理课程设计 任 务 书一、目的与要求1.这门课是为计算机科学与技术专业的学生在学习数据库原理后,为培养更好的解决问题和实际动手能力而设置的实践环节。通过这个环节,使学生拥有能够应用数据库原理对数据库系统进行设计的能力。为后继课程和毕业设计打下良好基础。2.通过该实验,培养学生在建立数据库系统过程中使用关系数据理论的能力。3.通过一个

2、学生并不陌生的完整系统的设计,可以培养学生对需求分析、方案设计、系统编码、界面设计和软件调试等各方面的能力。是一门综合考查学生数据库原理、面向对象设计方法、软件工程和信息系统分析与设计等涉及多课程的综合实验。二、主要内容信息管理系统的设计与实现是针对一个实际中小型系统(见题目附录)进行的数据库设计,它需要管理的内容有实体以及实体之间的联系。1. 首先要求完成需求的理解和实体的设计:a)设计实体的属性和码,以及该实体的实体完整性、用户自定义的完整性。b)设计实体的之间的联系,包括联系的类型和联系的属性,即设计实体参照完整性。最后画出完整的E-R图。2根据设计好的E-R图及关系数据库理论知识设计数

3、据库模式:2.1 将E-R图转换为关系模式。2.2 设计关系模式间的参照完整性。2.3 用SQL语言实现数据库模式的设计。 3实现信息管理系统所需的各种操作:3.1 用SQL语言实现信息的录入、删除和修改。 3.2 以视图的形式完成各类查询,包括单表、多表、单条件、多条件等。4权限的设计: 4.1 授权操作;4.2 收回权限的操作。 5界面的设计、加密的设计。三、 进度计划序号设计(实验)内容完成时间备注1根据任务书完成信息模型的设计,并将该信息模型在选用的DBMS中实现,并录入数据1天2根据任务书完成各种数据操作,并以视图的形式保留SQL语句。并开始界面的设计与编码1天3使用可视化开发工具开

4、发学生工作管理系统(C/S或者B/S模式)1天4界面设计,权限设计和调试1天5系统的完善与验收1天四、 设计(实验)成果要求1在DBMS(如SQL Server,DB2等)上完成完整的数据库的设计;2使用可视化开发平台完成该系统,并要可以求正确的运行;3完成实验报告。五、 考核方式1在微机上检查数据库设计的模式的设计、完整性的设计等;2在微机上检查系统的运行结果,并请学生解释所使用的技术;3实验报告的检查。六、 题目附录1学生信息管理信息系统2学生成绩管理信息系统3图书管理信息系统4物资管理信息系统5汽车销售管理信息系统6超市管理信息系统7通讯录管理信息系统8工资管理信息系统9酒店管理信息系统

5、10小区物业管理信息系统学生姓名:指导教师:郭丰娟 2014 年5月29日一、实验题目:图书管理信息系统二、实验目的与要求1.培养更好的解决问题和实际动手能力。通过这个环节,使学生具备应用数据库原理对数据库系统进行设计的能力。为后继课程和毕业设计打下良好基础。2.通过该实验,培养学生在建立数据库系统过程中使用关系数据理论的能力。3.通过对一个数据库系统的设计,培养学生对数据库需求分析、数据库方案设计、系统编码、界面设计和软件调试等各方面的能力。是一门考查学生数据库原理、面向对象设计方法、软件工程和信息系统分析与设计等课程的综合实验。三、实验原理系统所使用的原理有概念模型、三层模式、关系表理论、

6、范式理论等。四、实验所需仪器、设备计算机、MicrosoftSQLServer2008、MicrosoftVisualStudio2008。五、实验内容针对一个图书管理信息系统进行数据库设计,分析系统涉及的实体、实体之间的联系,实现增加、删除、更新、查询数据记录等基本操作。1.理解系统的数据库需求,分析实体及实体间联系,画出E-R图:1)分析确定实体的属性和码,完成对该实体的实体完整性、用户自定义完整性的定义。2)设计实体之间的联系,包括联系类型和联系的属性。最后画出完整的E-R图。2根据设计好的E-R图及关系数据库理论知识设计数据库模式:1)把E-R图转换为逻辑模式;将上述E_R图转换成二维

7、表(设计字段,确定字段的取值范围,字段名字,主键,字段的长度,确定自定义完整性,确定参照完整性)。 读者信息表 图书信息表 管理员信息表2)规范化设计。读者基本信息表、管理员信息表、图书信息表中均不含部分函数依赖和传递函数依赖,故此关系为3NF。3)用SQL语言完成数据库内模式的设计。3完成用户界面的设计,连接数据库,用C#语言实现系统所需的各种操作:实现数据记录的插入、删除、查询和修改;以视图的形式完成复杂查询,比如多表、多条件等。4. 使用Microsoft Visual 2008的窗体进行前台界面操作1)登录界面登录界面代码:using System;using System.Colle

8、ctions.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace LibraryManagement public partial class Form1 : Form public static string rname; public Form1() InitializeComponent(); private void butt

9、on1_Click(object sender, EventArgs e) if (this.username.Text.Trim() = & this.password.Text = ) MessageBox.Show(请输入您的用户名和密码!, 提示!); return; string level = comboBox1.Text.ToString(); try SqlConnection conn = new SqlConnection(); conn.ConnectionString = Data Source=localhost;Initial Catalog=libraryMS;I

10、ntegrated Security=True; conn.Open(); SqlCommand comm = new SqlCommand(); comm.Connection = conn; string a = username.Text.ToString(); string b = password.Text.ToString(); string str1=select * from reader where r_num= + a + and r_password= + b + ; string str2=select * from administrator where a_num=

11、 + a + and a_password= + b + ; if (level = 普通用户) comm.CommandText = str1; else comm.CommandText = str2; SqlDataReader dr = comm.ExecuteReader(); dr.Read(); if (dr.HasRows&level=普通用户) rname = drr_name.ToString(); MainForm af = new MainForm(); this.Hide(); this.username.Clear(); this.password.Clear();

12、 af.Show(); else if (dr.HasRows & level = 管理员) rname = dra_name.ToString(); AdministratorForm ad = new AdministratorForm(); this.Hide(); ad.Show(); else MessageBox.Show(账号或密码错误!, 提示!); this.username.Clear(); this.password.Clear(); this.username.Focus(); catch (Exception) MessageBox.Show(数据库无法连接!, 警告

13、!); private void button2_Click(object sender, EventArgs e) Application.Exit(); private void Form1_Closing(object sender, EventArgs e) Application.Exit(); private void Form1_Load(object sender, EventArgs e) comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; comboBox1.Text = comboBox1.Items0.ToStri

14、ng(); 2)普通用户界面普通用户核心代码:namespace LibraryManagement public partial class MainForm : Form public string strconn = Data Source=localhost;Initial Catalog=libraryMS;Integrated Security=True; public MainForm() InitializeComponent(); private void button1_Click(object sender, EventArgs e) Form1 aws = new Fo

15、rm1(); this.Hide(); aws.Show(); private void MainForm_Load(object sender, EventArgs e) string rname = Form1.rname; label4.Text = 欢迎 + rname + 登陆; this.AcceptButton = button2; private void button2_Click(object sender, EventArgs e) string lno = textBox1.Text.ToString(); string lname = textBox2.Text.To

16、String(); string lauthor = textBox3.Text.ToString(); string StrSql = select * from book where 1=1; DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(strconn) con.Open(); SqlCommand cmd = new SqlCommand(); using (cmd) if (!string.IsNullOrEmpty(lno) StrSql += and l_num=lno;

17、SqlParameter SpSname = new SqlParameter(lno, lno); cmd.Parameters.Add(SpSname); if (!string.IsNullOrEmpty(lname) StrSql += and l_name=lname; SqlParameter SpSclass = new SqlParameter(lname, lname); cmd.Parameters.Add(SpSclass); if (!string.IsNullOrEmpty(lauthor) StrSql += and l_author=lau; SqlParamet

18、er SpSclass1 = new SqlParameter(lau, lauthor); cmd.Parameters.Add(SpSclass1); cmd.CommandText = StrSql; cmd.Connection = con; using (SqlDataAdapter sda = new SqlDataAdapter(cmd) sda.Fill(dt); dataGridView1.DataSource = dt; 3)管理员图书管理界面管理图书核心代码:public partial class AdministratorForm : Form public stri

19、ng strconn = Data Source=localhost;Initial Catalog=libraryMS;Integrated Security=True; public AdministratorForm() InitializeComponent(); private void button3_Click(object sender, EventArgs e) /图书查询按钮 this.dataGridView1.AutoGenerateColumns = false; string lno = textBox6.Text.ToString(); string lname

20、= textBox7.Text.ToString(); string lauthor = textBox8.Text.ToString(); string StrSql = select * from book where 1=1; DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(strconn) con.Open(); SqlCommand cmd = new SqlCommand(); using (cmd) if (!string.IsNullOrEmpty(lno) StrSql

21、+= and l_num=lno; SqlParameter Splnum = new SqlParameter(lno, lno); cmd.Parameters.Add(Splnum); if (!string.IsNullOrEmpty(lname) StrSql += and l_name=lname; SqlParameter Splname = new SqlParameter(lname, lname); cmd.Parameters.Add(Splname); if (!string.IsNullOrEmpty(lauthor) StrSql += and l_author=l

22、au; SqlParameter Splauthor = new SqlParameter(lau, lauthor); cmd.Parameters.Add(Splauthor); cmd.CommandText = StrSql; cmd.Connection = con; using (SqlDataAdapter sda = new SqlDataAdapter(cmd) sda.Fill(dt); dataGridView1.DataSource = dt; private void dataGridView1_CellClick(object sender, DataGridVie

23、wCellEventArgs e) if (e.ColumnIndex = 5) string lno = dataGridView1.Rowse.RowIndex.Cells0.Value.ToString(); string lname = dataGridView1.Rowse.RowIndex.Cells1.Value.ToString(); string lau = dataGridView1.Rowse.RowIndex.Cells3.Value.ToString(); string ltype = dataGridView1.Rowse.RowIndex.Cells2.Value

24、.ToString(); string lpress = dataGridView1.Rowse.RowIndex.Cells4.Value.ToString(); textBox1.Text = lno; textBox1.ReadOnly = true; textBox2.Text = lname; textBox3.Text = lau; textBox4.Text = ltype; textBox5.Text = lpress; private void button1_Click(object sender, EventArgs e) string lno = textBox1.Te

25、xt.ToString(); string lname = textBox2.Text.ToString(); string lau = textBox4.Text.ToString(); string ltype = textBox3.Text.ToString(); string lpress = textBox5.Text.ToString(); string str = update book set l_name=lname,l_author=lau,l_type=ltype,l_press=lpress where l_num=lno; SqlParameter sp1 = new

26、 SqlParameter(lname, lname); SqlParameter sp2 = new SqlParameter(lau, lau); SqlParameter sp3 = new SqlParameter(ltype, ltype); SqlParameter sp4 = new SqlParameter(lpress, lpress); SqlParameter sp5 = new SqlParameter(lno, lno); using (SqlConnection conn = new SqlConnection(strconn) conn.Open(); using

27、 (SqlCommand cmd = new SqlCommand() cmd.Connection = conn; cmd.CommandText = str; cmd.Parameters.Add(sp1); cmd.Parameters.Add(sp2); cmd.Parameters.Add(sp3); cmd.Parameters.Add(sp4); cmd.Parameters.Add(sp5); int n = cmd.ExecuteNonQuery(); if (n 0) MessageBox.Show(更新成功); this.textBox1.Clear(); this.te

28、xtBox2.Clear(); this.textBox3.Clear(); this.textBox4.Clear(); this.textBox5.Clear(); private void button2_Click(object sender, EventArgs e) string lno = textBox1.Text.ToString(); string lname = textBox2.Text.ToString(); string lau = textBox4.Text.ToString(); string ltype = textBox3.Text.ToString();

29、string lpress = textBox5.Text.ToString(); if (lno = null | lno = | lname = null | lname = | lau = null | lau = | ltype = null | ltype = | lpress = null | lpress = ) MessageBox.Show(请完善信息,各项不能为空); else string str = insert into book (l_num,l_name,l_type,l_author,l_press) values (lno,lname,ltype,lau,lpress); SqlParameter sp1 = new SqlParamet

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

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