[阅读: 1113] 2007-05-12 17:17:20
存储过程:
ALTER PROCEDURE [dbo].[HR_Personnel_Login]
(
@UserID varchar(50),
@Password varchar(50)
)
AS
if exists
(
SELECT USRID
FROM HR_PersonnelInfo
WHERE USRID = @UserID
AND UsrPassword = @Password
)
-- 登录成功
RETURN 0
if exists
(
SELECT USRID
FROM HR_PersonnelInfo
WHERE USRID = @UserID
)
-- 登录失败 密码错误
RETURN 1
-- 登录失败 用户名不正确
RETURN 2
用ExecuteNonQuery来执行,如何得到RETURN值?
原文是result = (int)_command.Parameters["@RETURN_VALUE"].Value;
报错。。。