ok so im having trouble working out the best solution to this. i have a database with two tables as follows
I want to load a single date based on the ID but then load each content that has that dateIDFK - this is fine in sql however im trying to load the results into a listview control.
<asp:ListView ID="LVContentHome" runat="server" OnPagePropertiesChanging="listItems_PagePropertiesChanging" EnableModelValidation="false">
<LayoutTemplate>
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<div class="ContentDate">
<a><%# Eval("date", "{0:dd MMMM yyyy }")%></a> //loads date
<hr class="hrDate"/>
</div>
<div class="EntryText">
<p style="margin-top:5px;"><a><%#Eval("content")%></a></p> //loads content
</div>
</div>
</asp:ListView>
the problem is that the listview is expecting a date for each content that is loaded, however i only want to load the date once then load all the content under that single date, so its all grouped. for example:
RAW DATA
content1 = abc Date = 12.02.2012,
content2 = def Date = 19.09.2012,
content3 = hij Date = 12.02.2012
i want the listview to load as follows:
12.02.2012
abc
hij
19.09.2012
def
Any ideas or a better way to do this? any help will be great. thanks.