本文介绍如何建立基于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
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器