最新下载
热门教程
- 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
相关文章
- 蜜疯直播app财富等级在哪看 05-16
- 如何移除word红色波浪线 05-16
- 艾尔登法环黑夜君临法术和祷告流派施法限制是什么 05-16
- picacg哔咔注册验证?2026picacg哔咔账号注册指南 05-16
- 仙境传说重生服事怎么转职 05-16
- 7月10日光遇复刻先祖是谁 05-16