Wednesday, May 22, 2013

For the EntityDataSource, if the query specifies a projection and paging is enabled, a sort expression must be defined. Either set the OrderBy property or set AutoGenerateOrderByClause to true.

Use Order BY Clause

1:   <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Entities"  
2:      DefaultContainerName="Entities" EnableFlattening="False" EntitySetName="tblContacts"  
3:      EntityTypeFilter="tblContact" Select="it.[ContactCode], it.[FirstName], it.[LastName], it.[AddedAt] "  
4:      OrderBy="it.[AddedAt]">  
5:    </asp:EntityDataSource>  

No comments:

Post a Comment