avatar
Newbie ASP.NET question# DotNet - 窗口里的风景
r*n
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!
avatar
a9
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!

avatar
r*n
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

avatar
a9
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。