Skip to main content

Adding Query Data 2

We use the same technique to retrieve the remaining values from the result set: CategoryName, Length, and Rating. Note that we place all of the data in a single table cell, that is, between a single pair of <td></td> tags. We also surround the text labels for our data elements with <b></b> tags to improve their visibility on the page.

Here is the HTML:

—TopPicks.csp—
TopPicks.csp
<html> <body>
<h2><font color="#0000FF">Today's Top Picks</font></h2>
<table border=0>
<csp:query name="FilmList" classname="Cinema.Film" queryname="TopFilms">
<tr>
    <td>
    <b>#(FilmList.Get("Title"))#</b><br>
    #(FilmList.Get("Description"))#<br>
    <b>Genre</b>
    #(FilmList.Get("CategoryName"))#
    <b>Length</b>
    #(FilmList.Get("Length"))#
    <b>Rating</b>
    #(FilmList.Get("Rating"))#<br> <br>
    </td>
    <td></td>
</tr>
</table>
</body></html>
FeedbackOpens in a new tab