I have this function and I want to get distinct value in # Data #. but my problem is if there are two value with the same characters but one is Upper and one is Lower (i.e Comedy and comedy) it still have both value Comedy and comedy in my Data. So when I bind to Data...it shows both.
My function is:
public void LoadBookGenre(Book abc)
{
var loadbook = from Book s in BookDB.Books where s.Genre == abc.Genre select s;
BookAttribute.Clear();
foreach (Book m in loadbook) BookAttribute.Add(m);
List<Book> distinct = BookAttribute.GroupBy(a => a.Genre).Select(g => g.First()).ToList();
Data.Clear();
foreach (Book s in distinct) Data.Add(s);
}