Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
IEnumerable<Email> emails;
try
{
    emails = (from p in DatabaseConnection.Emails where p.Newsmail == true select p);
}
catch (Exception x)
{
    throw x;
}

Any suggestions how to sort the Enum list, to have ONLY one of each email adress in the list? The database table can have 2 instances of same email adress, so to keep spam away, I need to only have ONE of the instances in the mailing list...
Any suggestions?
Best regards
Posted
Updated 17-Feb-10 2:47am
v2

Try this:

emails = (from p in DatabaseConnection.Emails where  p.Newsmail == true select p).Distinct();
 
Share this answer
 
See here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900