如何在asp.net多语言网站中通过用户名获取用户详细信息
在我的多语言网站中,我选择阿拉伯语。 我从注册页面创建了一个用户。 现在,如果我使用该用户名登录,则会出现以下错误:
Failed to convert parameter value from a String to a Int64.
我已创建如下所示的存储过程:
SQL:
CREATE PROCEDURE [dbo].[UserLogin]
@UserName NVARCHAR(100)
AS
BEGIN
SELECT * FROM Users WHERE UserName = @UserName
END
ASPX 代码隐藏:
Dim UserName As String = "N'" & txtLogin.Text & "'"
Dim _dtLogin As DataTable = oUser.UserLogin(UserName)
业务逻辑:
Public Function UserLogin(ByVal UserName As String) As DataTable
_dbCommand = _database.GetStoredProcCommand("UserLogin")
_database.AddInParameter(_dbCommand, "UserName", SqlDbType.NVarChar, UserName)
_Dt = _database.ExecuteDataSet(_dbCommand).Tables(0)
End Function
In my multilingual website i select arabic language.
I created a user from registration page.
Now if i login with that username following error comes:
Failed to convert parameter value from a String to a Int64.
I have created stored procedure given below:
SQL:
CREATE PROCEDURE [dbo].[UserLogin]
@UserName NVARCHAR(100)
AS
BEGIN
SELECT * FROM Users WHERE UserName = @UserName
END
ASPX CODE BEHIND:
Dim UserName As String = "N'" & txtLogin.Text & "'"
Dim _dtLogin As DataTable = oUser.UserLogin(UserName)
BUSINESS LOGIC:
Public Function UserLogin(ByVal UserName As String) As DataTable
_dbCommand = _database.GetStoredProcCommand("UserLogin")
_database.AddInParameter(_dbCommand, "UserName", SqlDbType.NVarChar, UserName)
_Dt = _database.ExecuteDataSet(_dbCommand).Tables(0)
End Function
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论