Portal Engine
Version 3.x > Portal Engine > Get FileDescription for WebPart View modes: 
User avatar
Member
Member
fr-clmm - 11/18/2008 5:48:53 AM
   
Get FileDescription for WebPart
Hello,

i'm going to design a own webpart where i need to display the FileDescription value from Kentico.CONTENT_File Table...

My Code looks actually like this, but i haven't found a way to get the FileDescription yet:
_______________________________________
Dim ds As DataSet = CMS.CMSHelper.TreeHelper.SelectNodes(PartInstance.GetValue("Path"), False, "CMS.File")
Dim dr As DataRow

For Each dr In ds.Tables(0).Rows

'here i've got only access to Ketico.CMS_Documents-Table, how to get access to the Files-Table?

Next dr
_______________________________________

I've tried to use a relationship, but it won't work...

Thanks
Florian


User avatar
Member
Member
kentico_pavelk - 11/18/2008 6:27:08 AM
   
RE:Get FileDescription for WebPart
Hi Florian,

You can use custom query to get the descriptions from CONTENT_File table. The SQL query can look like this:
select FileDescription from CONTENT_File where FileID=<something>

User avatar
Member
Member
fr-clmm - 11/18/2008 9:27:12 AM
   
RE:Get FileDescription for WebPart
Okay, this is a possible way, i was thinking there's an internal reference to this object...

Where could i get the sql-connectionstring?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 11/18/2008 10:52:08 AM
   
RE:Get FileDescription for WebPart
Hi,

you could display the file description with our API by:

node.GetValue("FileDescription")

where node is of type: CMS.TreeEngine.TreeNode. You could gain it with the CMS.TreeEngine.TreeNode.TreeNode(dataRow,className) constructor.

The sql connection string is in your web.config. Its name is 'CMSConnectionString' by default.

Best regards,
Helena Grulichova