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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:12:07+00:00 2026-06-10T01:12:07+00:00

I have a C# application that performs ‘LINQ to Entities’ queries. The database it

  • 0

I have a C# application that performs ‘LINQ to Entities’ queries.

The database it is connected to is MS SQL 2012.
The database collation is ‘Hebrew CI’.

And still – if I perform a query like:

return users.Where(us => us.FirstName.Contains("joh"));

it does not fetch the records with ‘FirstName’ that has ‘John’. Only the ones with first name ‘john’.

I thought that this is determined on the SQL Server-side by the database collation, but obviously I am wrong …

Also – I have checked the ‘FirstName’ column’s collation, and it is set to ‘Database Default’.

What am I missing here ?

.

[ UPDATE ]

After reading some comments – I need to clarify :

I am using LINQ-TO-ENTITIES, not a local query.

The full piece of code is :

public List<User>   GetUsersByName(IMyDBEntities context, String filterBy)
{
    IEnumerable<User> users = context.Users;

    return users.Where(us => us.FirstName.Contains("filterBy"));  // filterBy = 'joh'
}

The full function contains more filters (filter by age, filter by address, etc…)

which all happen on the ‘server’ list of users, and only when I do ‘.ToList()’ does the query actually fire with all the filters.

  • 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-10T01:12:07+00:00Added an answer on June 10, 2026 at 1:12 am

    Likely, you are executing this Where call on a local collection, meaning you get LINQ to Objects semantics. You need to move it to a database query.

    Seeing the updated code the problem is apparent:

    IEnumerable<User>
    

    By declaring the sequence variable to be a local sequence, not a query, you make the compiler use local query operators, not remote query operators.

    The compile-time type must be IQueryable<User>.

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

Sidebar

Related Questions

I created a Windows Qt C++ application that performs some SQL queries. This application
I have a WCF application that sometimes performs long running queries. I have created
I have an application that performs a write to a database each time a
I have a simple Swing Java application that performs searches, and the results are
I have application that makes different queries with different results so the caching in
We have an application that performs auto-updates. Until recently, we haven't run into any
I have an application written in Java that performs some straightforward but time consuming
I have a simple little application that performs some analysis of all our corporate
I have a Google App Engine application that performs about 30-50 calls to a
we have a 500gb database that performs about 10,000 writes per minute. This database

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.