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?
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
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.
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.
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!
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:
This assumes that you have a usings statement in there as well
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.
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
is working on a reply...