CaseSensitiveCollation

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 23-Apr-2013 14:26:51   

LLBLGEN 4.0 LLBLGEN Run Time framework

Dear Team,

Just need one small help as to how to use CaseSensitiveCollation in my following code.

var title = new TitleCollection(); Filter.Clear();

            Filter.Add(new FieldCompareValuePredicate(TitleFields.Description, ComparisonOperator.Equal,
                                                      description))
                  .AddWithAnd(new FieldCompareValuePredicate(TitleFields.Flag, ComparisonOperator.Equal,
                                                             StaticVariableClass.Flagvalid));
            title.GetMulti(Filter, 0, null, null, null, null, 0, 0);
            return title.Count > 0;
Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 23-Apr-2013 18:08:59   

You should create a FieldLikePredicate with CaseSensitiveCollection=true. Example:

var likePredicate = new FieldLikePredicate(EmpFields.EmpName, theName.ToUpper());
likePredicate.CaseSensitiveCollation = true;

Otherwise you might just need to apply a DBFunctionCall (UPPER for example) on the required field, and provide the ToUpper() version of the string, to the predicate.

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 23-Apr-2013 18:46:40   

Walaa wrote:

You should create a FieldLikePredicate with CaseSensitiveCollection=true. Example:

var likePredicate = new FieldLikePredicate(EmpFields.EmpName, theName.ToUpper());
likePredicate.CaseSensitiveCollation = true;

Otherwise you might just need to apply a DBFunctionCall (UPPER for example) on the required field, and provide the ToUpper() version of the string, to the predicate.

Hope this is how it is !

var title = new TitleCollection(); Filter.Clear(); var likePredicate = new FieldLikePredicate(TitleFields.Description, description.ToUpper()); likePredicate.CaseSensitiveCollation = true; Filter.Add(new FieldCompareValuePredicate(TitleFields.Flag, ComparisonOperator.Equal, StaticVariableClass.Flagvalid)); Filter.Add(likePredicate); title.GetMulti(Filter, 0, null, null, null, null, 0, 0); return title.Count > 0;

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-Apr-2013 07:33:32   

Yes, that should work indeed. Give it a try wink

David Elizondo | LLBLGen Support Team