Ivica Basic

Ivica Basic

  • NA
  • 3
  • 0

How to perform case-sensitive query with LINQ?

Jun 1 2010 11:31 AM

I'm using C# in VisualStudio 2008 for database Windows application. I've got connection "db" to local database. Database contained table "tblBib" with string-type column "Redak". I want to query this table and get out all rows in which column "Redak" contains substring "Adams", but I don't want rows with substring "adams" or "aDams". I want case sensitive search.

I've tried this:

var linqUpit =

                    from redovi in db.tblBib

                    where redovi.Redak.Contains("Adams")

                    select redovi;

but this code gives back "Adams" and "adams" and "aDams".

What's missing?

Thanks.


Answers (3)