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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:23:34+00:00 2026-05-17T17:23:34+00:00

My problem is the following: I’m looking for a solution in LINQ which translates

  • 0

My problem is the following:

I’m looking for a solution in LINQ which translates a LINQ expression to SQL LIKE query.

(I know in LINQ I can use Contains, StarsWidth, EndWidth instead of ‘LIKE’ but in my case is not a good solution, and if you check the generated sql script you will see it is not use LIKE)

I found a lot of article that use the System.Data.Linq.SqlClient.SqlMethods.Like methods
so I wrote my query:

var query = from c in _context.prgCity where SqlMethods.Like( c.FullName, "%buda") select c.FullName + "|" + c.prgCountry.CountryName;

return query.ToList<string>();

But when query is running I get the following error message:

“LINQ to Entities does not recognize the method ‘Boolean Like(System.String, System.String)’ method, and this method cannot be translated into a store expression.”

Anybody can Help me what I do wrong?

  • 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-05-17T17:23:35+00:00Added an answer on May 17, 2026 at 5:23 pm

    You’re trying to use SqlMethods.Like when from LINQ to Entities. As per the documentation:

    This method is currently only supported in LINQ to SQL queries.

    You haven’t really explained why Contains/StartsWith/EndsWith don’t work for you (and in my experience they do get translated into LIKE clauses).

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

Sidebar

Related Questions

Problem: Following error is arising if I use NavigatorContent in Repeater. Is there a
I have following problem that in a transformation (which is completely done in memory)
i have following problem: I have a class Foo which encapsulates a web-api. the
I have the following problem: I have a Wintec WBT-202 GPS device which has
Problem The following scripts do exactly what I require, in all browsers tested except
I have following problem: My program should decide at runtime to load an function
I encountered following problem: I write program in c++ using VS2010. Debug build works
We have the following problem while running the git fsck --full --strict command: error:
I have the following problem. My application has a tab bar at the bottom
I have the following problem. I have done the following: In my css file,

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.