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

  • SEARCH
  • Home
  • 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 98675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:14:29+00:00 2026-05-11T00:14:29+00:00

How can I select multiple elements using a WHERE…IN… type of clause as in

  • 0

How can I select multiple elements using a WHERE…IN… type of clause as in

select * from orders where orderid in (1, 4, 5) 

in LinqToSql? I’d prefer not to have a lambda expression since they scare me.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T00:14:30+00:00Added an answer on May 11, 2026 at 12:14 am

    LINQ has ‘Contains’ which is like ‘IN’ but expressed the other way round – an element isn’t ‘in’ a set, a set ‘contains’ an element.

    int[] validIds = { 1, 4, 5 }; var query = from order in db.Orders             where validIds.Contains(order.Id)             select order 

    This is more simply expressed (IMO) with a lambda though:

    int[] validIds = { 1, 4, 5 }; var query = db.Orders.Where(order => validIds.Contains(order.Id)); 

    I realise lambdas are ‘new’ and therefore scary to some extent, but it’s really well worth grabbing hold of them with both hands. They’re lovely.

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

Sidebar

Related Questions

i have a form that has a multiple select drop down. a user can
I'm using some <select row=3 multiple=multiple> elements on a page. I've been trying to
How can I insert an <option> into a <select> (multiple) element using jQuery? (I
I have a <select> element with the multiple attribute. How can I get this
I have a code that removes an option element from a select multiple( <select
In certain text editors, like E, I can select multiple locations and, as I
Can I SELECT multiple columns into multiple variables within the same select query in
I can't find a way to select multiple items in an ASP.NET ListBox in
When I select multiple items in a ListBox , how can I display them?
I would like to know how can I use jQuery to select multiple items

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.