2012-01-13 53 views
1

有關最新的新聞項目我有以下代碼EntityDataSource我如何限制和按日期

<asp:EntityDataSource ID="entynews" runat="server" 
ConnectionString="name=CommerceEntities" 
DefaultContainerName="CommerceEntities" EnableFlattening="False" 
EntitySetName="news"> 
</asp:EntityDataSource> 

我怎麼限制記錄說五個還通過現場叫STARTDATE責令其退還最近的新聞。

問候 感謝 大衛·巴克利

回答

0

添加OrderBy財產如

OrderBy="startdate DESC" 

Select屬性例如,

Select="top(5) startdate, Another_Field" 

您的EntityDataSource聲明。