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
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