Partial Public Class WebForm1
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim adventureContext = New adventureWorks()
Dim original_employee = (From employee In adventureContext.Employees Select employee.Title)
Dim distinct_employee = (From employee In adventureContext.Employees Select employee.Title).Distinct()
GridView1.DataSource = distinct_employee
GridView2.DataSource = original_employee
Catch ex As Exception
And here's the compared result of two queries.
As you can see the original data are not sorted and repeatedly shown in the gridview
unlike when you used the distinct in Linq to sql the data are sorted and the
data shown distinctively.
That's it! Happy Coding. : )