Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > how to execute query in a custom web part? View modes: 
User avatar
Member
Member
steven4733-gmail - 1/11/2012 4:44:26 PM
   
how to execute query in a custom web part?
I was trying to mimic that simple chat function provided by Kentico. The link is http://devnet.kentico.com/Blogs/Martin-Hejtmanek/June-2010/DIT--How-to-make-a-chat-module.aspx But in the ChatInput web part cs code, it reports error says "'CMS.SiteProvider.CustomTableItemProvider' does not contain a definition for 'Connection' and no extension method 'Connection' accepting a first argument of type 'CMS.SiteProvider.CustomTableItemProvider' could be found (are you missing a using directive or an assembly reference?)"

I am using Kentico 6.0 version, is this the main reason that "Connection" is no longer available? Then how to execute query?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 1/16/2012 2:46:03 AM
   
RE:how to execute query in a custom web part?
Hello.

Yes, there was a change in API. To execute a query you can use following method:

CMS.DataEngine.GeneralConnection.ExecuteQuery(String queryName, QueryDataParameters)

Best Regards,
Radek Macalik