Hi, i need to get a users password from my database. I ask the user to enter his username in my textbox called txtUsername and his password in txtPassword. Then I try to use LinQ to sql to get the password.
My Code:
public string GetPasswordHash()
{
var varPasswordHash = (from m in dataContext.Members
where m.username == txtUsername.Text
select m.password);
string passwordHash = Convert.ToString(varPasswordHash);
lblBasehash.Text = passwordHash;
return passwordHash;
}
But this method only returns this:
SELECT [t0].[password] FROM [dbo].[Members] AS [t0] WHERE [t0].[username] = @p0