Duplicate Rows when Data Binding with LINQ to Entities

前端 未结 4 659
野性不改
野性不改 2020-12-05 19:38

I have problems binding both a telerik RadGrid and a plain vanilla ASP.NET GridView to the results of the following LINQ to entities query. In both cases the grids contain

4条回答
  •  庸人自扰
    2020-12-05 20:25

    One difference between your working and broken queries is the orderby clause. I found a documented bug in the orderby implementation in Linq to Entities... there may be others.

    Try removing orderby from the broken query and see if you still get duplicates.

    Another difference is the OR in the where clause. Try using only the first part [ where dp.LastName.StartsWith(searchTerm) ] and see if you still get duplicates.

提交回复
热议问题