BTW, here's a real-world subquery -- as described by Julian
-- that makes
the magic happen.
SELECT ContentID, Title, Subtitle
FROM Contentitems
WHERE (ContentID NOT IN
(SELECT TOP (1) ContentID
FROM Contentitems AS
Contentitems_1
WHERE (CategoryID = 34))) AND
(CategoryID = 34)
ORDER BY PubDate DESC
-KF
"Ken Fine" <kenfine@u.washington.edu> wrote in message
news:e7hgl2$4p4$1@forums.macromedia.com...
> Thanks to Kevin and Julian.
>
> Kevin's code worked, as follows, but led to unexpected
issues. First, the
> solution:
> protected void DataList2_ItemCreated(object sender,
DataListItemEventArgs
> e)
> {
> if (e.Item.ItemIndex == 0)
> {
> e.Item.CssClass = "Hidden";
>
> }
> }
>
> on the .ascx I deployed this to:
>
> <asp:DataList ID="DataList2" runat="server"
DataSourceID="SqlDataSource2"
> RepeatColumns="2" CellPadding="6" Width="87%"
RepeatDirection="Horizontal"
> OnItemCreated="DataList2_ItemCreated">
>
> ... and on the master page, in the <head> section:
>
> <style>
> .Hidden {display:none;}
> </style>
>
> This works fine. The issue you will run into is that a
DataList set to two
> RepeatColumns will render somewhat strangly if you hide
the topmost
> element. What you want and need in most cases is to fix
the data stream in
> the source SQL query or in the DataSet, which Julian's
code does.
>
> Thanks for the help, everyone.
>
> -KF
>
>
>
>
> "Julian Roberts" <nospam@charon.co.uk> wrote in
message
> news:e7gope$54p$1@forums.macromedia.com...
>> SQL for all data apart from first row:
>>
>> select * from t where id not in (
>> select top 1 id from t order by id
>> ) order by id
>>
>> --
>> Jules
>>
http://www.charon.co.uk/charoncart
>> Charon Cart 3
>> Shopping Cart Extension for Dreamweaver MX/MX 2004
>>
>>
>>
>>
>
>