最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用ASP和SQL实现基于Web的事件日历
时间:2022-06-30 10:14:49 编辑:袖梨 来源:一聚教程网
本文介绍如何建立基于Web的日历,同时为不熟悉Active Server Pages(ASP)、SQL和ADO的开发者提供建立Web站点的过程介绍,也为有经验的开发者提供了Web站点可伸缩性方面的技巧。
随着网络应用的发展,基于Web的日历越来越受到人们的重视,对于显示诸如最后期限或日程安排之类的重要事件,或显示谁在什么时候休假,基于Web的日历都是有用的。本文描述了如何使用IIS和SQL Server内的ASP建立一个非常简单的基于Web的日历,并允许你与其他人共享你的日程表或管理一组人员的日历。
建立SQL服务器端
对Web日历而言,我们在服务器端仅需保存表明事件性质的一个文本字符串即可,字符串最长为100个字符。设计源代码如下:
Calendar.sql
-- 创建表
create table Schedule
(
idSchedule smallint identity primary key,
dtDate smalldatetime not null,
vcEvent varchar(100) not null
)
go
-- 存储过程
create procedure GetSchedule (@nMonth tinyint, @nYear smallint)
as
select idSchedule, convert(varchar, datepart(dd, dtDate)) 'nDay', vcEvent
from Schedule
where datepart(yy, dtDate) = @nYear and datepart(mm, dtDate) = @nMonth
order by datepart(dd, dtDate)
go
create procedure AddEvent (@vcDate varchar(20), @vcEvent varchar(100))
as
insert Schedule
select @vcDate, @vcEvent
go
create procedure DeleteEvent (@idSchedule smallint)
as
delete Schedule where idSchedule = @idSchedule
go
随着网络应用的发展,基于Web的日历越来越受到人们的重视,对于显示诸如最后期限或日程安排之类的重要事件,或显示谁在什么时候休假,基于Web的日历都是有用的。本文描述了如何使用IIS和SQL Server内的ASP建立一个非常简单的基于Web的日历,并允许你与其他人共享你的日程表或管理一组人员的日历。
建立SQL服务器端
对Web日历而言,我们在服务器端仅需保存表明事件性质的一个文本字符串即可,字符串最长为100个字符。设计源代码如下:
Calendar.sql
-- 创建表
create table Schedule
(
idSchedule smallint identity primary key,
dtDate smalldatetime not null,
vcEvent varchar(100) not null
)
go
-- 存储过程
create procedure GetSchedule (@nMonth tinyint, @nYear smallint)
as
select idSchedule, convert(varchar, datepart(dd, dtDate)) 'nDay', vcEvent
from Schedule
where datepart(yy, dtDate) = @nYear and datepart(mm, dtDate) = @nMonth
order by datepart(dd, dtDate)
go
create procedure AddEvent (@vcDate varchar(20), @vcEvent varchar(100))
as
insert Schedule
select @vcDate, @vcEvent
go
create procedure DeleteEvent (@idSchedule smallint)
as
delete Schedule where idSchedule = @idSchedule
go
相关文章
- 差差漫画-韩漫免费在线阅读-差差漫画免费登录入口 02-04
- photoshop网页版快捷入口-photoshop官网极速下载 02-04
- picacg官网-最新入口2026 02-04
- 蛙漫2waman2官方正版-漫蛙manwa2正版直下 02-04
- 97影院在线观看最新电影:2026热播剧集同步更新,精彩不打烊 02-04
- 动漫亏成首富从游戏开始全16集夸克网盘资源链接1080p 02-04