我正在尝试查询访问数据库,以根据当前行列数据显示其他行。下面是我的代码和数据库查询。
<asp:ListView ID="RecentArtworkList" runat="server" DataSourceID="ArtworkDatabase2">
<ItemTemplate>
<p class="text"><asp:Label ID="ArtworkSubject" runat="server" Text='<%# Eval("ArtworkSubject")%>' /></p>
</ItemTemplate>
<asp:AccessDataSource ID="ArtworkDatabase2" runat="server" DataFile="~/app-data/content.mdb"
SelectCommand="SELECT [ArtworkTagPhotography], [ArtworkSubject], [ArtworkTimestamp], [ArtworkImageID]
FROM [artwork] WHERE ArtworkTagPhotography='digital-photography'">
<SelectParameters>
<asp:QueryStringParameter Name="ArtworkTagPhotography" QueryStringField="id" Type="String" />
</SelectParameters>
当前行有2个与之关联的标签(ArtworkTagPhotography,ArtworkTagPersonal)。我想根据这些标签显示前3行。每行将有2个不同的标签。