I have a asp.net 4 membership web with roles. When a user goes to change his password, I want to display that particular users Password Questiion. I added a dataset form view to the membership database and am able to achieve this by a sql query when I specify the users actual name in the query. I want to change my code to query the databased based on the user that is logged in.
Basically I want to change the part in my code that says
WHERE (aspnet_Users.UserName = 'RICK')
to something like
Where aspnet_users.username = (the currently logged in user)
I am not sure what to replace "the logged in user" with to make it equal the currently logged in user
any help would be appreciated.
SELECT aspnet_Membership.PasswordQuestion, aspnet_Membership.PasswordAnswer FROM aspnet_Membership INNER JOIN aspnet_Users ON aspnet_Membership.UserId = aspnet_Users.UserId WHERE (aspnet_Users.UserName = 'RICK')