This is a migrated thread and some comments may be shown as answers.

linq distinct problem how to write in distinct in linq qeryt

0 Answers 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 01 Apr 2010, 09:44 PM
Hi,

this is shanker MY requirement is linq distinct query my code this 

 public static List<sch_view_parent_student_search_lookup> sch_view_parent_student_search_lookup(int? faciltyid)
        {
            ComponentsDataContext db = DBManager.DataContext;
            var sch_view_class_student_list = (from even in db.sch_view_parent_student_search_lookup
                                              where even.facility_id==faciltyid
                                              select even. parent_person_id ).Distinct();
            return sch_view_class_student_list.ToList();
        }

Here i have one column parent_person_id that column must be in distinct how to write that .

i face one error this  is 

1 Cannot implicitly convert type 'System.Collections.Generic.List<int?>' to 'System.Collections.Generic.List<TelerikComponentsBL.sch_view_fee_student_schedule_fee_list>' D:\sama\asp\TelerikComponentsBL\feetranscationmanager.cs 25 20 TelerikComponentsBL

how to solve this  problem.and how to write Distinct of above query .

thanks and regards
shanker.B

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
shanker bangari
Top achievements
Rank 1
Share this question
or