用ASP和SQL實現基於Web的事件日曆

來源:互聯網
上載者:User
本文介紹如何建立基於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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.