Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7888893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:57:16+00:00 2026-06-03T05:57:16+00:00

I am trying to implement a Filter by Date on my hotel reservation project.

  • 0

I am trying to implement a Filter by Date on my hotel reservation project.

Could somebody help me please to convert this sql code to linq .

SELECT r.*
FROM Room r LEFT JOIN Reservation v ON r.RoomID = v.RoomID
AND NOT (@StartDate >= Date_Check_Out OR @EndDate <= Date_Check_In)
AND v.cancel = 0
WHERE v.ReservationID IS NULL
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:57:17+00:00Added an answer on June 3, 2026 at 5:57 am

    One of good tool to convert SQL to Linq : Linqer

    Try out this query

    var q = (from r in Room 
                join v in Reservation on r.RoomID equals v.RoomID  into outer
                from o in outer.DefaultIfEmpty()
                where !(o.Date_Check_Out<= startdate || o.Date_Check_In>=endDate)
                      && v.cancel == 0 && v.ReservationID == null 
                select r);
    

    Also check this :

    See SQL to LINQ Tool
    existing thread.

    If you decide to do it by hand, Linqpad should be useful.

    You also like to see : SQL to LINQ ( Visual Representation ) some good exaple by graphical representation…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement Custom Error handling via Action Filter Attributes. My code
I'm trying to implement a simple bilateral filter in javascript. This is what I've
I'm trying to implement chained filter dropdown using just javascript - jquery. The solution
I have this weird kind of error. I am trying implement basic Euclidean algorithm
I am trying to implement Ext.ux.grid.filter.ListFilter using a data store (rather than a hardcoded
I'm stuck trying to implement a user-configurable filter on a table using jQuery (in
I'm trying to implement this extenstion of the Karplus-Strong plucked string algorithm, but I
I am trying to filter the jqGrid data by date range - that is,
Im trying to implement a graphedit filter file i created. I am using 3ivx
I'm trying to implement email confirmation using Pyramid framework. Here's the code that confirms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.