I am trying to filter records basis on distinct . I used the following code
List<BALHotelList> searchresult = (from a in bh
join b in hr on a.HotelCode equals b.hotelCode
orderby a.HotelName
select new BALHotelList
{
HotelCode = a.HotelCode,
ImageURL_Text = a.ImageURL_Text,
HotelName = a.HotelName,
StarRating = a.StarRating,
HotelAddress = a.HotelAddress,
Destination = a.Destination,
Country = a.Country,
HotelInfo = a.HotelInfo,
Latitude = a.Latitude,
Longitude = a.Longitude,
HotelArea=a.HotelArea,
totalPrice = b.totalPrice,
totalPriceSpecified = b.totalPriceSpecified,
totalSalePrice = b.totalSalePrice,
totalSalePriceSpecified = b.totalSalePriceSpecified,
rooms = b.rooms,
boardType = b.boardType
}).ToList();
var uniqueArea =searchresult.Select(m => m.HotelArea).Distinct();
rptHotelArea.DataSource = uniqueArea;
rptHotelArea.DataBind();
but it's not finding HotelArea in data source .
but when i debug its shows me all distinct values in uniqueArea
the error is as following:
DataBinding: 'System.String' does not contain a property with the name 'HotelArea'.
EDITED
Here is repeater HTML
<asp:Repeater ID="rptHotelArea" runat="server">
<ItemTemplate>
<div class="sub-part1">
<a href="#"><%#Eval("HotelArea")%></a></div>
</ItemTemplate>
</asp:Repeater>