ASP.NET数据库调用问题
<asp:DataListID="DataList1"runat="server"DataSourceID="AccessDataSource1"RepeatDirect...
<asp:DataList ID="DataList1" runat="server" DataSourceID="AccessDataSource1"
RepeatDirection="Horizontal">
<ItemTemplate>
biaoti:
<asp:Label ID="biaotiLabel" runat="server" Text='<%# Eval("biaoti") %>'></asp:Label><br />
<br />
</ItemTemplate>
</asp:DataList><asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/news.mdb"
SelectCommand="SELECT [biaoti] FROM [jiaocheng] ORDER BY [id] DESC, [biaoti] DESC">
</asp:AccessDataSource>如何修改让其只显示5条最新的记录 展开
RepeatDirection="Horizontal">
<ItemTemplate>
biaoti:
<asp:Label ID="biaotiLabel" runat="server" Text='<%# Eval("biaoti") %>'></asp:Label><br />
<br />
</ItemTemplate>
</asp:DataList><asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/news.mdb"
SelectCommand="SELECT [biaoti] FROM [jiaocheng] ORDER BY [id] DESC, [biaoti] DESC">
</asp:AccessDataSource>如何修改让其只显示5条最新的记录 展开
3个回答
展开全部
select top 5 ...
order by id desc
or if you have date related to the records,
order by date desc
order by id desc
or if you have date related to the records,
order by date desc
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你也说了,要看记录,还是要看最新的,So。。查数据库,sql语句top5就好了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询