Sql_server数据库课程设计_图书馆管理系统

Sql_server数据库课程设计_图书馆管理系统
Sql_server数据库课程设计_图书馆管理系统

数据库课程设计

设计选题:图书管理系统

系别信息工程系

专业计算机网络技术

班级 01

姓名马斌龙

学号 0137

姓名王贤宽

学号 0137

姓名黄晓辉

学号 0140

指导老师

2011年12月29日

一.系统需求分析

图书管理工作繁琐,借阅频繁,包含大量的信息数据,因此就需要一个完善的图书管理系统来实现对这些数据的有效管理。本系统主要任务就是对图书、读者、借阅信息、查询进行

统一管理,满足各类用户的需求。本系统在功能上要实现借阅图书、续借图书、归还图书、催还图书、信息查询等功能。二.数据库分析

图书管理系统就是要求图书管理人员通过该系统对图书、读者、借阅信息等进行统一管理,从而实现功能上的借阅图书、

续借图书、归还图书、催还图书以及信息查询。这就要求管理人员能够对数据库进行熟练操作而简单的表查询、触发器的建立、存储过程的建立以及用户自定义函数的建立等等这些管理数据库的方法都能对图书馆里系统的管理起到事半功倍的效果。

五、图书馆管理系统功能算法实现

前台算法实现

主界面

图书信息查询


读者信息查询


借还信息记录

图书信息

无标题页



读者信息

无标题页



借还信息表

无标题页

添加图书

using System;

using ;

using ;

using ;

using partial class add : protected void Button1_Click1(object sender, EventArgs e)

{

string s1, s2, s3;

s1 = ;

s2 = ;

s3 = ;

string str = "server=WINKS80;database=图书管理系统;integrated security=true";

SqlConnection con = new SqlConnection(str);

SqlCommand com = new SqlCommand();

try

{

= con;

= "insert 图书信息表 values ('" + s1 + "','" + s2 + "','" + s3 + "')";

();

();

();

("插入成功");

}

catch (Exception a1)

{

("插入失败");

}

finally

{

();

}

}

删除图书

protected void Button3_Click(object sender, EventArgs e)

{

string s4;

s4 = ;

string str = "server=WINKS80;database=图书管理系统;integrated security=true";

SqlConnection con = new SqlConnection(str);

SqlCommand com = new SqlCommand();

try

{

= con;

= "delete 图书信息表 where bname = '" + s4 + "'";

();

();

();

("删除成功");

}

catch (Exception a1)

{

("删除失败");

}

finally

{

();

}

}

}

添加读者

using partial class manger : protected void Button1_Click(object sender, EventArgs e)

{

string s1, s2, s3;

s1 = ;

s2 = ;

s3 = ;

string str = "server=WINKS80;database=图书管理系统;integrated security=true";

SqlConnection con = new SqlConnection(str);

SqlCommand com = new SqlCommand();

try

{

= con;

= "insert 读者信息表 values ('" + s1 + "','" + s2 + "','" + s3 + "')";

();

();

();

("添加成功");

}

catch (Exception a1)

{

("添加失败");

}

finally

{

();

}

}

删除读者、

using System;

using ;

using ;

using ;

using protected void Button2_Click(object sender, EventArgs e) {

string s4;

s4 = ;

string str = "server=WINKS80;database=图书管理系统;integrated security=true";

SqlConnection con = new SqlConnection(str);

SqlCommand com = new SqlCommand();

try

{

= con;

= "delete 读者信息表 where rname = '" + s4 + "'";

();

();

();

("删除成功");

}

catch (Exception a1)

{

("删除失败");

}

finally

{

();

}

}

}

后台算法实现

创建数据库 (图书管理系统)

create database 图书管理系统

创建图书信息表

create table 图书信息表

( bid char(10) not null primary key,

bname nvarchar(15) not null,

bkind varchar(8) not null

)

创建读者信息表

create table 读者信息表

( rid char(10) not null primary key,

rname nvarchar(15) not null,

rkind varchar(8) not null

)

创建借还书信息表

create table 借还书信息表

( recordid bigint identity(1,1) not null primary key,

bid char(10) foreign key references 图书信息表(bid),

btimes bigint not null,

retime smalldatetime not null,

bstat bit not null

)

六.实训心得

通过本次的课程设计,我清楚的感觉SQL的重要性。在生活或工作中有很大的实用性。而本次实训又让我从新认识到了SQL模型的创建、应用、完整的数据库管理系统。现在我正在努力掌握SQL数据库管理系统及其应用开发技术。这次的试训让我更好的掌握SQL打好了坚实的基础。我相信我以后会制作出很好的数据库系统。

相关主题
相关文档
最新文档