linq distinct problem how to write in distinct in linq qeryt

1 posts, 0 answers
  1. shanker bangari
    shanker bangari avatar
    106 posts
    Member since:
    Jan 2010

    Posted 01 Apr 2010 Link to this post

    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

Back to Top