Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 528.2k

Linq Query

Apr 26 2023 11:01 AM

Hi

  I am trying below query. I want only those books from t2 which have BookRpl = 4 and does not exists in View_SessionBookPlanningRecommendations for students (1,17,18)

                    LMSDBDataContext context = new LMSDBDataContext();
                    var objResult = (from t in context.View_SessionBookPlanningRecommendations
                                     from t2 in context.View_BookDetails
                                     from t3 in context.StudentDetails
                                     where (int)t.BookID == (int)t2.ID
                                     && t2.BookRPL == "4"
                                     
                                     && t.BookID != 65
                                     orderby t.Name
                                     select new
                                     {
                                         t.GroupName,
                                         t.SessionDate,
                                         t.BookTitle,
                                         t.MentorName,
                                         t.Name
                                     }).ToList();

Thanks


Answers (6)