日期:2014-05-17  浏览次数:20483 次

急急急:::Gridview不分页实现pagesize功能?
用一个DataView和SqlDataSource配套使用显示数据,想不分页,但只显示数据库最后的8条记录。怎么实现呢??
  <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString31 %>"
  ProviderName="<%$ ConnectionStrings:ConnectionString31.ProviderName %>" SelectCommand='SELECT TOP 8 * FROM "INDEX_NEWS" ORDER BY "NEWS_ID" DESC'>
  </asp:SqlDataSource>


  而当我改成SelectCommand='SELECT TOP 8 * FROM "INDEX_NEWS" ORDER BY "NEWS_ID" DESC'
的时候就出错

------解决方案--------------------
单双引号换下行吗?
------解决方案--------------------
还是自己写的顺手,比较怪
------解决方案--------------------
SelectCommand='SELECT TOP 8 * FROM INDEX_NEWS ORDER BY NEWS_ID DESC'