Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 08, 2013 03:17 AM by Nick Asiimwe
Member
141 Points
280 Posts
Jan 08, 2013 12:58 AM|LINK
I have code like this:
var GenreQry = from d in db.Movies orderby d.Genre select d.Genre;
I tried select d.Genre.Distinct but it doesnt work
How can i make it work?
thx
Adilson
Participant
1042 Points
190 Posts
Jan 08, 2013 03:17 AM|LINK
Try this.
var GenreQry = (from d in db.Movies orderby d.Genre select d.Genre).Distinct();
1459 Points
643 Posts
http://stackoverflow.com/questions/5035048/linq-to-entities-distinct-clause
http://stackoverflow.com/questions/8473705/linq-to-entities-distinct-on-one-column
anderson7777
Member
141 Points
280 Posts
How do i use distinct?
Jan 08, 2013 12:58 AM|LINK
I have code like this:
var GenreQry = from d in db.Movies
orderby d.Genre
select d.Genre;
I tried select d.Genre.Distinct but it doesnt work
How can i make it work?
thx
Adilson
pro.shailend...
Participant
1042 Points
190 Posts
Re: How do i use distinct?
Jan 08, 2013 03:17 AM|LINK
Try this.
var GenreQry = (from d in db.Movies
orderby d.Genre
select d.Genre).Distinct();
Blog: Dot Net Tricks Windows Apps
Please "Mark As Answer" if my suggestions helps you
Nick Asiimwe
Participant
1459 Points
643 Posts
Re: How do i use distinct?
Jan 08, 2013 03:17 AM|LINK
http://stackoverflow.com/questions/5035048/linq-to-entities-distinct-clause
http://stackoverflow.com/questions/8473705/linq-to-entities-distinct-on-one-column
Sincerely,
Nick
ASP.NET, SQL Server [Database Engine, SSIS & SSRS],Entity Framework, C# and VB.NET