Ron Harlev
Ron Harlev

Reputation: 16673

is there a way to get all profiles in ASP.NET membership

Is there an API in the ASP.NET membership, implementation to get all user profiles at once. If not, is there another good way to get all the names (first + last) of all the users. I'm trying to avoid the many SQL requests generated by getting the user profiles one at a time.

Upvotes: 0

Views: 701

Answers (2)

womp
womp

Reputation: 116977

ProfileProvider.GetAllProfiles().

I'd still recommend just adding first and last names to the MembershipUser though. You'll need to cast your provider to the concrete type, which is brittle if you ever want to change it.

Upvotes: 3

Peter Lillevold
Peter Lillevold

Reputation: 33920

Update:

A challenge with the way profile data is stored is that the property names and values are packed and stored in two columns in the Profile database. If you run the aspnet_Profile_GetProperties sproc you will see that.

There is no out-of-the-box sproc that gets profile data for all users. A quick modification to the aspnet_Profile_GetProperties would do that for you though.

Upvotes: 2

Related Questions