Content Management System and E-commerce for ASP.NET
MY ACCOUNT SHOPPING CART
  phone U.S. TOLL-FREE NUMBER:
1-888-225-2767
 
 
DevNet > Knowledge base > Portal Engine > Displaying custom data
   

Displaying custom data

Sometimes you may want to display the data stored in the database within your custom table. This brief article describes the way how you are able to achieve this using the portal engine development model without need to use any additional development tool.

Applies to: Kentico CMS 2.x/3.x


Sometimes you might need to display the data stored in the custom tables. In this case the Kentico CMS provide you with the web parts supporting the custom queries- the QueryRepeater, the QueryDataList and the QueryDataGrid. Using these web parts you are able to display any data, especially the data that aren't related to any document type. Let's say you want to display all the newsletter issues with some additional data.

First you would need to create the custom query. You could create it through the 'Site manager-> Development-> Document types-> <selectDocumentType>-> Edit-> Queries-> New Query'. Please note it really doesn't matter which document type you choose for your query. The simple query could look like:

SELECT * FROM Newsletter_NewsletterIssue


Then you should create the transformation used to display the obtained data. Please note the exact column names should be used for evaluating the content. You should use the same column names as specified in the database. The transformation could then look like:

<b>Issue subject: <%# Eval("IssueSubject") %></b><br/>
Number of sent e-mails: <%# Eval("IssueSentEmails") %><br/>
Number of unsubsribed users: <%# Eval("IssueUnsubscribed") %><br/>
<br/>
Finally you can add the web part with custom query to your page. Select the custom query defined above, use the transformation specified earlier and display the content. The result could be the following:

See also:
 
     
     
 

Technical Support

If you do not find an answer to your questions here, please contact our technical support at support@kentico.com.