Skip to main content
April 20, 2006
Question

asp.net Problem with repeat region

I have a page with a repeat region that's supposed to show the guestbook entries from a d-base. I have the dataset set up to sort in descending order based on the date but it's not sorting for some reason. Below is the code. The date field is set up as a date/time field in the Access D-base. Any idea why it's not sorting?
This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
April 20, 2006
I am not sure if it is what is causing the problem but the word DATE is one
that should not be used when naming database fields as it is reserved in
SQL.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"schristy" <webforumsuser@macromedia.com> wrote in message
news:e282g9$4o5$1@forums.macromedia.com...
>I have a page with a repeat region that's supposed to show the guestbook
> entries from a d-base. I have the dataset set up to sort in descending
> order
> based on the date but it's not sorting for some reason. Below is the
> code.
> The date field is set up as a date/time field in the Access D-base. Any
> idea
> why it's not sorting?
>
>
> <%@ Page Language="VB" ContentType="text/html"
> ResponseEncoding="iso-8859-1" %>
> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
> Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,cultu
> re=neutral" %>
> <MM ataSet
> id="guestbookdataset"
> runat="Server"
> IsStoredProcedure="false"
> ConnectionString='<%#
> System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_gue
> stbook") %>'
> DatabaseType='<%#
> System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETY
> PE_guestbook") %>'
> CommandText='<%# "SELECT * FROM guestbook ORDER BY ""DATE"" DESC" %>'
> Debug="true"
> ></MM ataSet>
> <MM ageBind runat="server" PostBackBind="true" />
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> " http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>Mr C's Guestbook</title>
> </head>
> <body>
> <p align="center"><strong><font size="5" face="Verdana, Arial, Helvetica,
> sans-serif">Mr. C's Guestbook</font></strong></p>
> <table width="740" border="1" cellspacing="2" cellpadding="1">
> <ASP:Repeater runat="server" DataSource='<%#
> guestbookdataset.DefaultView
> %>'>
> <ItemTemplate>
> <tr>
> <td width="245" valign="top"><p><font size="2" face="Verdana,
> Arial,
> Helvetica, sans-serif"><strong>Name:</strong> <%#
> guestbookdataset.FieldValue("NAME", Container) %></font></p>
> <p><font
> size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Date
> Posted:</strong> <%# guestbookdataset.FieldValue("DATE", Container)
> %></font></p></td>
> <td width="479" valign="top"><font size="2" face="Verdana, Arial,
> Helvetica, sans-serif"><%# guestbookdataset.FieldValue("MESSAGE",
> Container)
> %></font></td>
> </tr>
> <tr bgcolor="#CCCCCC">
> <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica,
> sans-serif"> </font></td>
> </tr>
> </ItemTemplate>
> </ASP:Repeater>
> </table>
> <p> </p>
> </body>
> </html>
>


Translate
April 21, 2006
Aaaaah. I never thought of that. I guess I should have checked my SQL list of reserved words. Thanks for the help.

Translate