Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to make Accent Insensitive search

Posted on 2008-10-16
5
Medium Priority
?
420 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 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

782 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