Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dimitris Papadimitriou 14 posts 34 karma points
    Jul 30, 2011 @ 11:00
    Dimitris Papadimitriou
    0

    How to create view of data that includes membership from cmsContentXml

    Hi!

    I'm developing a custom asp.net control to be used on umbraco. This control will display some data that come from a custom table in the same database of umbraco that contain order information. Since this table has a reference to a member (currently the Member.NodeId but I can change that if you recommend something else), I want to dispaly in that view the Member Name (not loginName) and perhaps other custom information that come from Member Type.

    How do you suggest I do that, since this information is in XML in the cmsContentXml table?

    thanks!

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 01, 2011 @ 13:45
    Sebastiaan Janssen
    0

    I suggest never to access the Umbraco tables directly, whatever you need to do can be done through the API, so if you want to access members you can just do something like:

    var myMember = new Member(memberId);

    This assumes that you have a usings statement in there as well 

    using umbraco.cms.businesslogic.member;
  • Dimitris Papadimitriou 14 posts 34 karma points
    Aug 03, 2011 @ 16:10
    Dimitris Papadimitriou
    0

    Hi and thanks for your reply!

    I understand this, but I want to present a list of Orders with customer information combined in it. Using the API would mean that I would have to call it several times to get each member's information. This would result in multiple round trips to the database. I want to avoid that as well.

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 08, 2011 @ 22:32
    Bo Damgaard Mortensen
    0

    Hi Dimitris,

    Is it possible for you to give us an overview of your custom tables in the database? :-) Because if you store the member id on the Orders table, you should be able to do exactly what Sebastiaan wrote in his post. As Sebastiaan also wrote, there's a lot of caching going on in the Umbraco app pool, so accessing/manipulating data in any of the Umbraco tables should be avoided.

    Anyway, it would be helpful to get an overview of your tables.

    / Bo

Please Sign in or register to post replies

Write your reply to:

Draft