Implementing a Web-based Event calendar with ASP and SQL
Source: Internet
Author: User
This article describes how to build a web-based calendar while providing a process for creating Web sites for developers unfamiliar with active Server Pages (ASP), SQL, and ADO, as well as providing experienced developers with tips on Web site scalability.
With the development of Web applications, web-based calendars are becoming more and more popular, and web-based calendars are useful for displaying important events such as deadlines or scheduling, or showing who is on vacation. This article describes how to use IIS and the ASP in SQL Server to create a very simple web-based calendar and allow you to share your schedule with others or manage a group of people's calendars.
Build SQL Server Side
For Web calendars, we only need to save a text string that indicates the nature of the event on the server side, with a string up to 100 characters long. The design source code is as follows:
Calendar.sql
--Create a table
CREATE TABLE Schedule
(
Idschedule smallint Identity Primary key,
Dtdate smalldatetime NOT NULL,
Vcevent varchar (MB) NOT NULL
)
Go
--Stored procedures
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), @vcEvent varchar (100))
As
Insert Schedule
Select @vcDate, @vcEvent
Go
CREATE PROCEDURE deleteevent (@idSchedule smallint)
As
Delete Schedule where idschedule = @idSchedule
Go
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.