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 59939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:05:02+00:00 2026-05-10T18:05:02+00:00

I have a method that needs to accept an array of country names, and

  • 0

I have a method that needs to accept an array of country names, and return a list of records that match one of those country names. I’m trying this

Public Shared Function GetConcessions(ByVal Countries As String()) As IEnumerable     Dim CountryList As String = Utility.JoinArray(Countries) ' turns string array into comma-separated string     Return (From t In New Db().Concessions _                     Where CountryList Like t.Country _                     Select t.ConcessionID, t.Title, t.Country) End Function 

but I get this error

  *Only arguments that can be evaluated on the client are supported for the LIKE method 

In plain SQL, this would be simple:

 Select ConcessionID,Title from Concessions c where @CountryList like '%' + c.Country + '%' 

How can I achieve this result in Linq to SQL?

Edit (clarification)

I get the same message with string.Contains. It would be fine with

t.Country.contains(CountryList) 

but I need

CountryList.contains(t.Country)  

and that throws the same error I listed above.

  • 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. 2026-05-10T18:05:02+00:00Added an answer on May 10, 2026 at 6:05 pm

    I think what you want to do is construct a List from Countries and use

    List<string> ListOfCountries = new List(Countries)  ...ListOfCountries.Contains(t.Country) 

    This would translate into

    t.Country IN ('yyy','zzz',...) 

    Please excuse my C#-ishness..

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

Sidebar

Related Questions

I have a JavaScript method that I need to run on one of my
I need a Regex that will match a java method declaration. I have come
I have class method that returns a list of employees that I can iterate
I have a method that can return either a single object or a collection
I have a method that where I want to redirect the user back to
I have a method that takes an IQueryable. Is there a LINQ query that
I have a number of view specs that need certain methods to be stubbed.
I have a need for methods in several classes that must always follow a
I have a interface that defines some methods with attributes. These attributes need to
I am trying to write a socket server that forks for every connection. I

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.