Ramco Ramco

Ramco Ramco

  • 473
  • 2.8k
  • 394.6k

Linq query join

Jul 4 2022 2:55 PM

Hi

  In below query i have 2 tables joined. In aspx page i want to display data from these 2 tables in a repeater.

Is it possible

public List<View_SessionDeliveryCalendarDetail> GetSessionPlanPriority(DateTime frDate, DateTime toDate, Int32 MentorId, Int32 GroupID)
        {
            List<View_SessionDeliveryCalendarDetail> Result = (from t in context.View_SessionDeliveryCalendarDetails
                                                               join t2 in context.View_SessionDetails
                                                               on t.SessionPlanID equals t2.SessionPlanID
                                                               where t.SessionDate.Value.Date >= frDate.Date && t.SessionDate.Value.Date <= toDate.Date
                                                               
                                                               orderby t.SessionDate
                                                               select t).ToList();
            return Result;
        }

Thanks


Answers (4)