How to fetch user details by user name in multilingual website in asp.net
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 Data开发者_运维百科Table = 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
精彩评论