Request Data as case-insensitive

Posts   
 
    
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 02-Apr-2012 16:15:59   

Hi,

I am using LLBLGen Pro 3.1, Oracle 11i and SQL2008.

Is there is any way to request data from database in case-insensitive way? I don't need data to be match for case sensitive in database.

e.g. When user types UserName, he can type in any case he wants and i want to return data.

Thanks

Rishi

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Apr-2012 05:37:45   

Hi Rishi,

There a two important things to notice if you want to work on insensitive data:

  1. Insensitive filters. You have to convert any string filters into insensitive. If your DB is in insensitive collation, you don't have to worry about that. Otherwise you have to specify that the filter is insensitive. To do so you need to use the CaseSensitiveCollation in the FieldLikePredicate. Example:
FieldLikePredicate likeFilter=
PredicateFactory.Like(AFieldIndex.A, toSearch.ToUpper());
likeFilter.CaseSensitiveCollation = true;

To sort data it works similar, you have to set sortClause.CaseSensitiveCollation to true.

  1. In memory comparisons. There are situations where LLBLGen needs to discriminate the data in-memory. For example the PrefetchPaths: in order to add entities to the corresponding navigators, LLBLGen use a StringComparer. You have to signal that LLBLGen Runtime must use an insensitive comparison. Please read the first Note rectangle in the PrefetchPath's docs section.
David Elizondo | LLBLGen Support Team