Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GetUsersByProfileProperty HelpGetUsersByProfileProperty Help
Previous
 
Next
New Post
6/20/2008 3:12 PM
 

 

, 1, 1000, 2)

 

 

Hi Everyone,

 

I've created a custom user profile property called "Departments" which is a list of internal departments.  I'm trying to use the GetUsersByProfileProperty() method, but I can't seem to get it to work.  I've executed the associated stored procedure, and it works fine when I give it the appropriate arguements.  Can someone tell me what I'm doing wrong?  Arguments are hard coded, but PropertyValue argument will eventually will come from a DropDownList control.

 

 

 

alUsers = DotNetNuke.Entities.Users.UserController.GetUsersByProfileProperty(0,

Dim alUsers As New System.Collections.ArrayList"Departments", "6", 1, 1000, 2)

Thanks,

Rob

 

 
New Post
6/23/2008 3:43 PM
 

I solved my problem after looking closely at GetUsersByProfileProperty() parameter list.  Maybe someone else my find this thread helpful.

Dim totalRecords As New Integer

alUsers = DotNetNuke.Entities.Users.UserController.GetUsersByProfileProperty(0,

"Departments", "6", 1, 1000, totalRecords)

 

 
New Post
6/23/2008 3:53 PM
 

I'm going to guess your formatting up above is not true to your actual code, but I've inserted a snippet below that should work for you (copied straight from my own code, just replacing the profile property name):

Dim tmpCount As Integer = 0
Dim tmpArray As ArrayList = DotNetNuke.Entities.Users.UserController.GetUsersByProfileProperty(portalId, "Departments", "6", 0, 100, tmpCount)

You'll note that I'm setting page 0 (it is returning on a base zero array, not base 1 like VB.NET typically is), 100 records though you can use your 1000, and then the tmpCount is how many are actually being returned and is passed by reference.  In other words, if only 2 actually came back, tmpCount would have been set to 2 during the call. 

Based on the weird formatting in your post, I'm not sure where the problem lies.

Hope that helps?


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
6/30/2008 3:41 PM
 

 

That did the trick!  Yes.  For some reason, the formatting of my code snippet got out of wack.  Thanks for the follow up!

Rob

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GetUsersByProfileProperty HelpGetUsersByProfileProperty Help


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out