Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to make Accent Insensitive search

Posted on 2008-10-16
5
Medium Priority
?
414 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 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