Loading...
Uploaded by aceoft on May 7, 2009
In this tutorial, I show you how I re-use content in Kentico CMS, a web site content management system that I use. (Part 2 of 2)
Science & Technology
Standard YouTube License
Just few notes ... you are using way too many DB accesses to get that data. 1) Get NodeID, 2) Get the node data and convert it to object (very expensive), 3) Get the Document itself. You can do all this with just single GetDocuments call like this:
DataSet ds = TreeHelper.GetDocuments(CMSContext.CurrentSiteName, "/%", culture, className, "NodeGUID = '" + nodeGuid + "'", null, -1, true, 0);
string content = (string)ds.Tables[0].Rows[0]["Content"];
This way you save the most of overhead.
KenticoCMS 2 years ago
Load more suggestions
Just few notes ... you are using way too many DB accesses to get that data. 1) Get NodeID, 2) Get the node data and convert it to object (very expensive), 3) Get the Document itself. You can do all this with just single GetDocuments call like this:
DataSet ds = TreeHelper.GetDocuments(CMSContext.CurrentSiteName, "/%", culture, className, "NodeGUID = '" + nodeGuid + "'", null, -1, true, 0);
string content = (string)ds.Tables[0].Rows[0]["Content"];
This way you save the most of overhead.
KenticoCMS 2 years ago