I'm currently using a DataList to display a list of photos. Each photo column is in different rows in DB table and the rest of columns are the same to each other.
When I open page where DataList is in, it shows me extra same posts (added photos count more). How can I bind the data from different rows into one Datalist?
What I want to do is to show only one post using DataList by combining the same rows (except photo path)
DB Table Example:
Design:
<asp:DataList ID="dlresimYoluMulti" runat="server" RepeatColumns="2"
CellPadding="2" CellSpacing="2" >
<ItemTemplate>
<a href="#">
<img id="imgResimm1" src="../Path/<%#Eval("ResimYolu") %>" width="275"
alt="<%#Eval("ResimAdi") %>" class="w3-margin-bottom" />
</a>
</ItemTemplate>
</asp:DataList>
.CS
DataList MFU = (DataList)e.Item.FindControl("dlresimYoluMulti");
DataTable dtMulti = system.GetDataTable("SELECT DISTINCT * FROM SOMEHERE");
if (dtMulti.Rows.Count > 0)
{
MFU.DataSource = dtMulti;
MFU.DataBind();
MFU.Dispose();
}