首页 >> 读书频道 >> 电脑 >> 会员系统例子:
 
· Visual C#常用函
· 基于FORM的验证
· 基于WINDOWS的验证
· MD5算法之C#程序 M
· Application的
· 对C#开发两个基本原则的
· Application和
· 编写global.asa
· 配置Config.web
· 用C#代码编写的SN快速
· 用Visual C#实现
· 应用程序
 
· 电视剧《刁蛮公主》下载和
· 美容养颜手册
· 加油金顺剧情分集介绍完整
· 红楼梦:120回全本[清
· 素质教育在美国
· 全唐诗卷四十六
· 韩剧《布拉格恋人》剧情介
· 夜航船[作者:明·张岱]
· 局外人[作者:韩·可爱淘
· 现场流行病学
· 源氏物语[日本:紫式部]
· 武林寓言故事
 
· (出租)中动商场部分及写
· (出租)中动动漫基地&#
· 喜剧学院
· 《善德女王》剧情介绍
· 魔女18号 剧情
· 丑女无敌剧情介绍
· 魔女幼熙剧情介绍
· 龙游天下剧情介绍
· 震撼世界的七日剧情介绍
· 静静的白桦林剧情介绍
· 心情日记—老公今天我想对
· 旗舰剧情介绍
欢迎来到月影社区!如果您觉得这里不错,请推荐给您的朋友们。月影社区:http://wf66.com/

会员系统例子:


查看有无更新版本

关键字:ASP.NET 2006-9-20

 

4.6.1 数据库:
 我们建立两个表City和Customer,在建立几个存储过程来操作数据库(member.sql):
 
 CREATE TABLE [dbo].[City] (
 [ID] [int] NOT NULL ,
 [Name] [nvarchar] (20) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[customer] (
 [ID] [int] IDENTITY (1, 1) NOT NULL ,
 [Name] [nvarchar] (30) NULL ,
 [sex] [bit] NOT NULL ,
 [Birth] [smalldatetime] NULL ,
 [City] [int] NULL ,
 [Zip] [nvarchar] (6) NULL ,
 [Address] [nvarchar] (50) NULL ,
 [Telephone] [nvarchar] (30) NULL ,
 [PIN] [nvarchar] (30) NULL ,
 [Password] [nvarchar] (30) NULL ,
 [EMail] [nvarchar] (30) NULL ,
 [Question] [nvarchar] (50) NULL ,
 [Answer] [nvarchar] (50) NULL
) ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [GetAllCities] AS
 Select [ID],[Name] From City
GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [GetDetailByID]
@ID Int
AS
Select PIN,Password,[Name],Birth,Sex,City,Zip,EMail,Telephone,Address,Question,Answer,[ID]
From Customer
Where [ID]=@ID


GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [GetDetailByPIN]
@PIN NVarChar(30)
AS
Select PIN,Password,[Name],Birth,Sex,City,Zip,EMail,Telephone,Address,Question,Answer,[ID]
From Customer
Where [PIN]=@PIN

 

GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  ON    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [IsValidUser]
@PIN NVarChar(30),
@Password NVarChar(30),
@ID Int Output
AS

Select @ID=[ID] From Customer Where PIN=@PIN and Password=@Password


GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [Modify]
@ID Int,
@PIN NVarCHar(30),
@Password NVarCHar(30),
@Name NVarCHar(30),
@Birth DateTime,
@Sex bit,
@City int,
@Zip NVarCHar(6),
@EMail NVarCHar(30),
@Telephone NVarCHar(30),
@Address NVarCHar(30),
@Question NVarCHar(50),
@Answer NVarCHar(50)
AS

Update Customer
Set Password=@Password,[Name]=@Name,Birth=@Birth,Sex=@Sex,City=@City,Zip=@Zip,EMail=@EMail,Telephone=@Telephone,Address=@Address,Question=@Question,Answer=@Answer
Where ID=@ID And PIN=@PIN


GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  ON    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [PromptPassword]
@PIN nvarchar(30),
@Answer nvarchar(50),
@Password nvarchar(30) output
AS
select @Password=Password From Customer Where PIN=@PIN And Answer=@Answer


GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [PromptQuestion]
@PIN nvarchar(30),
@Question nvarchar(50) output
AS
select @Question=Question From Customer Where PIN=@PIN

 

GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

CREATE PROCEDURE [Register]
@ID Int OUTPUT,
@PIN NVarCHar(30),
@Password NVarCHar(30),
@Name NVarCHar(30),
@Birth DateTime,
@Sex bit,
@City int,
@Zip NVarCHar(6),
@EMail NVarCHar(30),
@Telephone NVarCHar(30),
@Address NVarCHar(30),
@Question NVarCHar(50),
@Answer NVarCHar(50)
AS

Insert Into Customer (PIN,Password,[Name],Birth,Sex,City,Zip,EMail,Telephone,Address,Question,Answer)
Values (@PIN,@Password,@Name,@Birth,@Sex,@City,@Zip,@EMail,@Telephone,@Address,@Question,@Answer)

SELECT @ID = @@IDENTITY


GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

会员系统例子:

[ 1 ]
会员系统例子: num

打印本页 关闭

关于我们版权声明本站导航友情连结作品演示 TOP↑