This project has moved and is read-only. For the latest updates, please go here.

Getting slkuser info from memberships.learners

Topics: Developer Forum, Project Management Forum, User Forum
Mar 19, 2008 at 11:04 PM
In my project we use SLK. In this, I need to find user name in memberships.learners object.

For this, I loop through memberships.learners and find the required the user

I had given the code below

foreach (SlkUser slkUser in memberships.Learners)
// UserID contains the user name
Int32 lsPosition1 = (slkUser.Name.ToUpper().IndexOf(UserID.ToUpper(), 0));
if (lsPosition1 > 0)

long userKey;
//Get the Userkey
userKey = slkUser.UserId.GetKey();

Since there are more than 1000 users, this process takes too long. Is there a better way to get the slkuser info from membership.learners??