SELECT Stores.strStoreName,
(CASE WHEN T.intItemID=S.MinSub THEN Stores.strLogo ELSE NULL END) AS displayCategory,
T.txtDescription
FROM Items AS T
INNER JOIN
Stores ON T.intStoreID = Stores.intStoreID,
( SELECT intStoreID , Min(intItemID ) AS MinSub
FROM Items
GROUP BY intStoreID ) AS S
WHERE T.intStoreID = S.intStoreID
ORDER BY T.intStoreID, T.intItemID
The SQL works, but I need to do some formatting within the datagrid but I am unsure of the best way...
<asp:GridView Width="100%" BorderWidth="0" CellPadding="0" CellSpacing="0" BorderColor="white"
AutoGenerateColumns="FALSE" ShowHeader="false" ID="gvStores" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td valign=top width="110px">
<img border="0" src="images/<%# Eval("strLogo")%>" />
</td>
<td valign=top class="bluebodytext">
<%# Eval("txtDescription")%>
<i>Offer Expires <%# String.Format("{0:d}",Eval("dtmExpiration")) %></i>
</td>
</tr>
</table>
<div class="row">
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
It display data like this
StoreImage 1 Item 1
Item 2
Item 3
StoreImage 2 Item 1
Item 3
What I need to do is insert an HR AFTER the StoreImage(n) like this
StoreImage 1 Item 1
Item 2
Item 3
_______________________
StoreImage 2 Item 1
Item 3
Is there any simple way I could accomplish this??
Thanks