How to deal with filter on accented eltters?

Posts   
 
    
Max avatar
Max
User
Posts: 221
Joined: 14-Jul-2006
# Posted on: 22-Jun-2007 10:10:04   

My DB have a Customers table with an Address column I want to fetch customers filtering on Address column.

In my DB I have a customer with Address = 'Viale della Gioventù n.15'

It is possible to create a like filter predicate using the search sting 'gioventu', and fetch even the row that contains different accent like 'Viale della Gioventù n.15'.

How will LLBLGen deal with accented letters for DB fetch filtering? How will LLBLGen deal with accented letters for in-memory filtering?

I'm using: *) .Net 2.0, VisualStudio 2005 *) LLBLGenPro 2.0.0.0 Final (March 21st, 2007) *) Code generation: Adapter/VB.Net 2.0/Standard Templates+CommonBaseClass *) LLBLGenPro Lib 2.0.07.0416 *) Database: Access2k / SQL Server 2k

Thanks, Max

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Jun-2007 10:19:02   

Is your database collation accent sensitive?

Max avatar
Max
User
Posts: 221
Joined: 14-Jul-2006
# Posted on: 22-Jun-2007 11:17:06   

Walaa wrote:

Is your database collation accent sensitive?

Mmm... for SQL Server 2k, i believe that depend on string column property. But I never tried to force some collation type on a column.

For MS Access, I don't know disappointed

Do LLBLGen do something related to collation type? or it's totally DB dependent? And whats about collation for in-memory filtering?

Thanks, Max

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Jun-2007 11:43:25   

Do LLBLGen do something related to collation type? or it's totally DB dependent?

It's totally database dependant.

And whats about collation for in-memory filtering?

I think it's a case sendetive & accent sensetive by default (.NET strings comparison default behaviour).

Check out the following article to know how to strip accents from latin characters: http://www.codeproject.com/csharp/UnicodeNormalization.asp

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39912
Joined: 17-Aug-2003
# Posted on: 23-Jun-2007 11:23:47   

In-memory filtering can be case-insensitive, just set the collation flag similar to db filtering using a like predicate.

It simply passes on the strings it gets, so if the value to compare has 'u' in the name and you use a pattern with 'ù' in the name, it won't match, as the characters don't represent the same character: they're different.

Frans Bouma | Lead developer LLBLGen Pro