Solved

How to make Accent Insensitive search

Posted on 2008-10-16
5
392 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
Comment Utility
have you tried
where d.Name.ToLower().Contains(textToSearch.ToLower())
0
 

Author Comment

by:Morris7
Comment Utility
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
Comment Utility
Quote :
"I need to modify this function so it will be case insensitive"
0
 

Author Comment

by:Morris7
Comment Utility
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
Comment Utility
Now try to answer the corected question if you can...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.NET Error 7 42
AutoHotkey ActiveX Component Error 8 55
Convert to Hour/minute textbox and compare 3 35
VB.NET HttpWebRequest 12 30
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now