Solved

How to make Accent Insensitive search

Posted on 2008-10-16
5
399 Views
Last Modified: 2013-12-17
I need to modify this function so it will be case insensitive. My server (Sql2008) is set with the correct collation, so if i query directly against the database the result is OK. But i query from a preloaded list (to speed up things).

 How can this be achived?

Here is the C# function:

        internal IEnumerable<BO.DriverSearchGridBO> ApplySearchTextFilterTogrid IEnumerable<BO.DriverSearchGridBO> list, string textToSearch)
        {
            IEnumerable<BO.DriverSearchGridBO> newlist =
                  from d in list
                  where d.Name.Contains(textToSearch)
                  select d;
            return newlist;
        }

Thanks,
0
Comment
Question by:Morris7
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 22730658
have you tried
where d.Name.ToLower().Contains(textToSearch.ToLower())
0
 

Author Comment

by:Morris7
ID: 22730692
I asked ACCENT insensitive...

Your solution is for CASE insensitive comparison.

This one is a little bit tougher:)
0
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 22730881
Quote :
"I need to modify this function so it will be case insensitive"
0
 

Author Comment

by:Morris7
ID: 22731320
Sorry for the typo. The title says ACCENT but i screw up the descriptions.

I will give you points:)
0
 

Author Closing Comment

by:Morris7
ID: 31506703
Now try to answer the corected question if you can...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question