Searching string without case sensativity

Posts   
 
    
Posts: 18
Joined: 06-Dec-2012
# Posted on: 11-Apr-2013 21:45:29   

I'm trying to use the generated code to search on string column. I'm converting my value in my vb.net application to all upper case. I need to change the value of the collection I'm searching on. How can I use that in a FieldLikePredicate?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 12-Apr-2013 07:41:06   

FieldLikePredicate has a CaseSensitiveCollaction property. When set to true, you will get a case-insensitive compare. That means that LLBLGen will generate an UPPER(SomeField) SQL. i.e.:

// This filter will perform a case-insensitive search
FieldLikePredicate filter = new FieldLikePredicate(EventFields.Name, "test".ToUpper());
filter.CaseSensitiveCollaction = true;
David Elizondo | LLBLGen Support Team