Answered by:
Getting user's information

Question
-
User272600043 posted
Hello dear all!
I am currently working on "My information" page for the users. I am using VS's own create user wizard and its own database. But I am confused to get inofrmation of the user that is logged in. My database's name is(aspnetdb.mdf) and I have an sqldatasource (called sqldatasource1). Now what I want datasource to do is retreiving the data of the user that is logged in. For example My user name is "Admin". When I open "My information Page" datasource will retrieve the informiaton where column username(in the DB) equals "Admin"(the username). How can I do that. I tried some codes but they didn't work. WHen I write them gridview comes empty. I tried (User.IDentity.Name) But it didn't work.
I am waiting for your answers
Thanks!
Friday, January 25, 2013 12:42 PM
Answers
-
User3866881 posted
But plus that I want users to see their own information in a page.Just use the specific user's Info such as ID to query out all the info from the user and use output to page.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, January 30, 2013 9:21 PM
All replies
-
User2110019919 posted
Seems like you need to setup the ASP.NET Membership roles/providers.
Do you want users to create, login and view pages?
If so, then read this:http://weblogs.asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and-Roles-Tutorial-Series.aspx
You can create your own "users" table/objects, but Microsoft has it built in already.
Friday, January 25, 2013 6:06 PM -
User272600043 posted
Hello!
First of all thank you for your answer. The artciles are really great but unfortunately ı couldn't find my answer :( In admin page I can get user's info. that's okay. But plus that I want users to see their own information in a page.
Thanks!
Sunday, January 27, 2013 2:28 AM -
User3866881 posted
But plus that I want users to see their own information in a page.Just use the specific user's Info such as ID to query out all the info from the user and use output to page.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, January 30, 2013 9:21 PM