搜索文章:

首页  |  Java技术  |  Asp.net  |  Asp编程  |  VC/C++  |  Delphi  |  VB编程

用ASP和SQL实现基于Web的事件日历

 本文介绍如何建立基于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
相关文章:
© 2006   www.java-asp.net