-1

I have a SQL ,that have to combine two table (DormApplications as d and DormRooms as r) with d.DormRoomId and r.id ,but how to translate it to LINQ and how to get the selected value ?

        String username = Utility.Decryption(LoginAccount);
        string now = DateTime.Now.ToShortDateString();
        string SQL = "select top 1 name ,Sdate,Edate,DormRoomId,r.RoomId  as room from DormApplications d, DormRooms r where  d.DormRoomId = r.id and d.Poster = '" + username + "'  and d.review = 1 and '"+now+ "' > d.Sdate and '" + now + "' < d.Edate order by d.Edate desc;";

how to translate it ? when it translate to LINQ ,how to get name ,Sdate,Edate,DormRoomId,r.RoomId as room ?

georgetovrea
  • 511
  • 1
  • 8
  • 24
  • In response to your edit: is there anything about the linked question that is unclear as to how to apply it to your current query? – DiplomacyNotWar May 10 '22 at 01:08

0 Answers0