Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
HI, Im trying to populate all members with profile properties, athough I have successfully done this but It's loading too slow.
public static XPathNodeIterator GetAllMembers()
XmlDocument membersXML = new XmlDocument();
//For each member in a specific member group
foreach (Member memb in Member.GetAll)
//The current member object - get the XML
//New XMLNode for <member>
XmlNode membNode = membersXML.CreateElement("member");
XmlAttribute membAttrID = membersXML.CreateAttribute("memberID");
membAttrID.Value = memb.Id.ToString();
foreach (Property prop in memb.getProperties)
XmlNode propNode = membersXML.CreateElement(prop.PropertyType.Alias);
//Set the value
propNode.InnerText = prop.Value.ToString();
//Append Property node to member node
//Append to <members> root node
catch (Exception ex)
membersXML.LoadXml("<response><success>false</success><error>" + ex.Message.ToString() + "</error></response>");
When I'm iterating through members I'm using the uQuery extension "GetMembersByXPath(string xpath)" from uComponents. This loads the members from the XML cache instead of loading them from the database by calling Member.GetAll. Should increase performance a lot by doing it this way :-)
Grab uComponents here: uComponents
The reference you need are uComponents.Core and you're good to go!
The XPath code would then look something like this:
var members = uQuery.GetMembersByXPath("//*");
Where "members" is your collection of members that you can loop through.
Let me know if there's any hold-ups :-)
All the best,
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted