Can I filter a list based on Profile Value

D

Doownai

Hi,

I have a listbox that I populate with a list of all users for the application:

listUsers.DataSource = Membership.GetAllUsers

I would like to have a listbox that is populated by all users in the
application that share a certain profile value. something along the lines of:

listUsers.DataSource =
Membership.GetAllUsers(Profile.BloomerColour = "red")

The idea is to allow local security administrators to manage only those
users who share the same department IDs

I appear to have gone utterly blind to figuring this out. A nudge in the
proper direction would be greatly, greatly appreciated.

Cheers.

VS2005 8.0.50727.42
..NET
2.0.50727
 
D

Doownai

A little clumsy but it serves my purpose for now. I am dealing with hundreds
of people rather than thousands. The list will populate with only those
users who are in the same department as the local administrator.

Feel free to comment.

ListBox1.Items.Clear()
For Each user As MembershipUser In Membership.GetAllUsers()
If Profile.GetProfile(user.UserName).CUNum = Profile.CUNum Then
ListBox1.Items.Add(user.UserName)
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top