Retrieving User profile values for all users.

Hi, I had a search but could not find the answer to this question.

 I am wanting to be able to retrieve all the individual profile values for every user and then show their first and last name in a drop down list so that I can select the name (value will be username).

 I thought of gathering all the usernames in a datareader, then looping through each username and add the user profiles to a dataset, but how do I get the user profile values? I have found how to get the profile values for individual users when they have logged in using the ProfileBase =  HttpContext.Current.Profile method, but how would I do this to get the profile using each username ?


Thanks for the help.

Get busy Livin, or get busy dyin.
3/27/2007 9:58:40 AM 27051 articles. 1 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 50

How about something like this: 
System.Collections.Generic.SortedList<string> names = new System.Collections.Generic.SortedList<string>();
string[] usernames = Membership.GetAllUsers();

foreach (string username in usernames)
	ProfileCommon profile = ProfileBase.Create(username) as ProfileCommon;
	names.Add(String.Concat(profile.LastName, ", ", profile.FirstName));

DropDownList1.DataSource = names;

Thanks, Ed

Microsoft MVP - ASP/ASP.NET

3/27/2007 12:52:55 PM

Similar Artilces:

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database) Help pleaseee Hi You could take a look at this :,Young Fang Hi ...

Single Users Profile and All Users Profiles List
I've made a discussion forum. And I have also installed simply membership. Now I want after click on user link to redirect to the page with User's info.I have simply user "John" and user "Bob" and everyone can click on those names and will see page with informations stored in Profile (Like Profile.Name, Profile.Address). I have three simply question:1. How to show profile values of other User ? Like I wrote above.2. How to list all users with for example their e-mails ? I mean: UserLogin - UserName - UserMail3. Or the easier way is to make new table with those all information an...

User and User Profile Storage
How would you handle these situations? 1st Situation Storing user and user's profile information in the database. I have two ideas to handle this. #1) Store all the users information in one table #2) Store only the information needed to login the user in the user table, and have a userProfile table to store the rest of the user's profile information. Why? #1) Easy to build queries for, but will cause more overhead when the user is simply logging in. However, it will cause a lower overhead when looking up a user's profile information, as there will be no need to do table jo...

User Wordlist in User-Profile
high i saw in the TID10080800 that it is possible to point the User Word-List in example to a network drive like H:\\WT61US.UWL. how can i point it to the Userprofile like C:\Document and Setting\%USER%\\WT61US.UWL so it is copied to the server everytime the user logs out, but it is local for the notebook user's ? i dont now how to set it in the registry, that it point to the User-Profile. thanks Sascha Sascha, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has you...

Retrieve user login details and respective user profile in one datatable to show in grid
Hii would like to retrieve all my membership account and there profile details in one datatable or to one dataset so that i can show them in grid.following is what i triedprotected MembershipUserCollection msc;protected ProfileInfoCollection upc; msc = Membership.GetAllUsers();UserGrid.DataSource = msc;UserGrid.DataBind();upc = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.Authenticated);The difficulty i am having is join these collections into one datatable. in the above code i show all my user details but would like to show there respective profile details tooThanks in advance ...

How secure passing user credentials like user name, password values in query string to httphandler
Hi,  How secure passing user credentials like user name, password values in query string to httphandler like login.ashx?uid=xxx&pwd=yyy  Surendra SurendraIf this helps mark it as answer I believe it's very insecure. Anyone who is smart enough can get the credentials from the querystring directly.Thanks,MaxLet Me Google That For You!  Have a look at Create a querystring that is encrypted and expires at I would not recommend any design that passed user name and password in the query strin...

Editing User Profile... set a textbox on Page_Load and retrieve updated value on submit
I'm creating a web site where each user has a user profile; the profile contains information like first and last name, email, etc. When the user views the details of their account, they have the option to edit these fields. When they click the edit button, they are taken to a page that has text boxes for every field of their profile information. The text boxes are set with their existing information. The user can then edit as many fields as they choose and then submit the changes. I have created hidden fields for each value they might change to differentiate between the original value th...

manage default user profile for all users
We're are halfway through a rollout of all new machines (W2K SP3). I just discovered that you can change the default user profile to a custom one by copying over the default user profile in W2k. This could save me tons of time, as it takes care of all the nitpicky stuff (IE6, Office 2k, media player, etc) that one has to setup for each user. Unfortunately, we've already ghosted our machines with the standard default user profile (and I'm not planning on going back and reloading a custom profile on each machine). My question is this. Is it possible using z...

retrieve user info from user directory
i have to retrieve user information from active directory in ASP.NET by passing employee id to it. i'm building an web application usinf visual studio 2008 and C#. Can anyone plz give me some information on how shoiud i do this      Hi, please go through the sample code below..   public static DirectoryEntry GetDirectoryEntry(string DomainReference) { string ADFullPath = "LDAP://"; DirectoryEntry de = new DirectoryEntry(ADFullPath + DomainReference, UserName, Password, AuthenticationTypes.Secure); retur...

Allowing users to view other users profiles
 Iv created a basic social networking site Using the built in membership roles provider and its working great. So far users can signup and create a profile, login edit their profile and upload an avatar. Also close their account and view a list of all site members.  But the one thing Iv not firgured out yet is how to allow users to view the profiles of other users. What I want to do is have a the usernames in the userlist display link to the the profile of the particular user. Now I assume I will have to send the username in the query string to the profile page but how do I extract...

user table/user profile ques
hi i have my own user table with user profiles, password to merge it with the dnn user table... is there any way. i am confused as it seems i wil have to create 100's of user in order to make dnn fucntioning for al the usersany inputs on this?thanks somebody must have faced some issues ref the same?/// anyone has any idea..   pls suggest i am stil looking for any info /feedback if anyone can giveit will be a big helpthanks In general, it is possible in DNN3 by writing your own membership provider, replacing the original Microsoft membership provider, that is used as a...

Modify User Information / User Profile
I have been rooting around looking for the answer... with no luck... I want to modify the User Information / User Profile collected, for example delete MSN, AIM and Yahoo and add City, State and Zip. Where is this? Is it right in front of my nose? Thanks in advance, (again). The table in the DB is the Community_Users table. You will have to either extend this table, or create a new table using a foreign key relationship to the users table to hold your new fields. You probably don't need to mod any stored proc though since the profile procedures use select * (bad design, but ...

Accessing Profile of users other than current user.
I want to access profile of other users. I want to allow my members to visit other members profile. I am not going to disply the senstive information. The default sql profile provider access to profile of current user only. Hi you need to use the getProfile function as follows:ProfileCommon UserProfile = Profile.GetProfile(UserName); UserProfile.PropertyName1=....   Please read this related thread :   Regards,Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wron...

Users customise their profile page for all users
Hi there I am a bit of a newbie to ASP.NET.  All my web development experience before has been with good old asp pages! So anyways here's what I was wondering.  I have a page called ViewProfile which displays the information about a particular user.  The information is pulled from a users table stored in SQL server.  The user profile displayed is determined by the id parameter passed in the url (for example - ViewProfile.aspx?id=123).  This allows other users of the system to see another users profile (the appropriate links etc are on the pages). Now here'...

Web resources about - Retrieving User profile values for all users. -

Mother of three killed landlord after he tried to stop her retrieving her son's shirt
A mother of three has been found guilty of killing her landlord after he tried to stop her retrieving a red polo shirt her son needed for school ...

Retrieving bodies a 'horrifying' experience (01:43)
Anti-jump measures on the Story Bridge should be "fast tracked" and water police funding increased so CityCats don't have to pick up bodies. ...

Man drowns retrieving toy boat
A man has drowned after entering the Wimmera River at Horsham to retrieve a remote-controlled boat.

Bishop says there is no time limit on retrieving MH17 remains
THE Australian Federal Police have warned that it is too dangerous to approach the MH17 crash site in war-torn eastern Ukraine until security ...

Search underway for man swept away in Brisbane River while retrieving toy boat
A search is underway for a man swept away in the Brisbane River while retrieving a toy boat.

DPRK blames US for suspension of retrieving American soldiers' remains
DPRK blames US for suspension of retrieving American soldiers' remains People's Daily Online PYONGYANG, Oct. 13 The Democratic People's Republic ...

Good dog: Yankee retrieving a big Canada in a Manitoba hayfield
Good dog: Yankee retrieving a big Canada in a Manitoba hayfield

iPhone dev: Retrieving user phone numbers
... a secret to recovering user phone numbers that does not involve the … One of the most common questions I get these days has to do with retrieving ...

Girl stuck in Dover storm drain retrieving phone
A teenage girl gets stuck in a storm drain in Dover while trying to retrieve her mobile phone which had fallen into it.

Forensic investigations: Retrieving data from the cloud
... ensure that nothing is missed in the evidence gathering process, and to ensure that the investigative team doesn’t run out of time when retrieving ...

resources last updated: 11/20/2015 12:33:43 PM