
Code:
To eliminate duplicate elements from a sequence.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQ
{
class Program
{
static void Main(string[] args)
{
DataClassesDataContext dc = new DataClassesDataContext();
IQueryable<String> empQuery = (from emp in dc.EmpDetails
select emp.Dept).Distinct();
foreach (String dept in empQuery)
{
Console.WriteLine(dept);
}
Console.ReadLine();
}
}
}


Join the conversation! Your thoughts help the community grow.