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