boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - Newbie ASP.NET question
相关主题
SSIS --- SQL Server 2005
求救一个小问题
Entity Framework Open Sourced
asp.net里,每个user加一個用戶头像,头像存在哪个表里?
Windows filesystem bug
nHibernate mapping question
System.Data.SqlClient.SqlException: A network-related or instance -specific error
error .mdf file unable to attach in Visual Studio 2013 win (转载)
大侠,推荐一本比较好的VB.net的入门书吧
Newbie Question about Debugging
相关话题的讨论汇总
话题: password话题: userid话题: return话题: end话题: function
进入DotNet版参与讨论
1 (共1页)
r*****n
发帖数: 92
1
It's a simple log in form using stored procedure to verify user id and
password. The User table has fields of UserID- varchar(15) and Password -
char(6).
The strange thing is I cannot receive the return value for password from the
application side. The sp works fine if I execute it using command. But if I
revise the data type of password to varchar I get the password value
returned...
Is there anything different between varchar and char regarding .net
application?
Thanks!
a9
发帖数: 21638
2
你调存储过程的地方怎么写的?

the
I

【在 r*****n 的大作中提到】
: It's a simple log in form using stored procedure to verify user id and
: password. The User table has fields of UserID- varchar(15) and Password -
: char(6).
: The strange thing is I cannot receive the return value for password from the
: application side. The sp works fine if I execute it using command. But if I
: revise the data type of password to varchar I get the password value
: returned...
: Is there anything different between varchar and char regarding .net
: application?
: Thanks!

r*****n
发帖数: 92
3
I used sqlhelper class from Application block.
"ses" is my session variable class and ses.s is temporary session variable.
below is the code:
/*method validUserID is to verify id*/
Public Shared Function validUserID(ByVal userid As String) As Boolean
ses.s = (SqlHelper.ExecuteScalar(db.db_connection, CommandType.
StoredProcedure, sp.dptValidateUserID, New SqlParameter("@Userid", userid)))
db.CloseIfOpen()
If userid = ses.s Then
ses.UserId = userid
ses.RtnMsg = Nothing
Return True
Else
ses.RtnMsg = err.msgUser_Invalid
Return False
End If
End Function
/*method is to get password based on verified userID from method validUserID
*/
Public Shared Function validPassword(ByVal password As String) As Boolean
db.CloseIfOpen()
If password = (SqlHelper.ExecuteScalar(db.db_connection, CommandType
.StoredProcedure, sp.dptValidateUserPassword, New SqlParameter("@Userid",
ses.UserID), New SqlParameter("@Password", password))) Then
ses.RtnMsg = Nothing
Return True
Else
ses.RtnMsg = err.msgUser_Pass
Return False
End If
End Function
........

【在 a9 的大作中提到】
: 你调存储过程的地方怎么写的?
:
: the
: I

a9
发帖数: 21638
4
password你补成6位了吗?

))
validUserID
CommandType

【在 r*****n 的大作中提到】
: I used sqlhelper class from Application block.
: "ses" is my session variable class and ses.s is temporary session variable.
: below is the code:
: /*method validUserID is to verify id*/
: Public Shared Function validUserID(ByVal userid As String) As Boolean
: ses.s = (SqlHelper.ExecuteScalar(db.db_connection, CommandType.
: StoredProcedure, sp.dptValidateUserID, New SqlParameter("@Userid", userid)))
: db.CloseIfOpen()
: If userid = ses.s Then
: ses.UserId = userid

1 (共1页)
进入DotNet版参与讨论
相关主题
Newbie Question about Debugging
[合集] 说到netadvantage
[合集] Log on to a remote computer
[合集] How to tell if a connection is http or https?
Re: 问一个,WP上的软件是什么写的? (转载)
Pass passwords etc sensitive info
asp.net问题急问(初级)
请教VB.net中如何取得Oracle Error code
Help!!!How to open a file on the network
c# smtpclient's atthenication
相关话题的讨论汇总
话题: password话题: userid话题: return话题: end话题: function