CaseSensitiveCollation

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 14-Oct-2013 08:45:24   

LLBlgen 4.0 Sql Server 2008 C# Windows Application LLBLgen runtime framework.

Dear Team,

How can I set CasesensitiveCollation=true for the "description" in the following code ?


public static DataTable TitleView1(string description)
        {
            Filter.Clear();
            _sort = null;
            var titleview = new TitleViewTypedList();
            Filter.Add(new FieldCompareValuePredicate(TitleFields.Flag.SetObjectAlias("T"), ComparisonOperator.Equal,
                                                      PublicConstantClass.Validflag));
            Filter.AddWithAnd(new FieldLikePredicate(TitleFields.Description.SetObjectAlias("T"),
                                                     ChangeCaseClass.Cleanstring("%" + description + "%")));
            _sort =
                new SortExpression(TitleFields.Description.SetObjectAlias("T") | SortOperator.Ascending);
            titleview.Fill(0, _sort, true, Filter);
            return titleview;
        }

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39912
Joined: 17-Aug-2003
# Posted on: 14-Oct-2013 11:10:44   

by first creating a variable which you give as value: FieldLikePredicate(TitleFields.Description.SetObjectAlias("T"), ChangeCaseClass.Cleanstring("%" + description + "%"))

and then set the flag on the variable?

Frans Bouma | Lead developer LLBLGen Pro
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 14-Oct-2013 12:00:25   

Otis wrote:

by first creating a variable which you give as value: FieldLikePredicate(TitleFields.Description.SetObjectAlias("T"), ChangeCaseClass.Cleanstring("%" + description + "%"))

and then set the flag on the variable?

I can interchange the lines.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39912
Joined: 17-Aug-2003
# Posted on: 14-Oct-2013 16:30:17   

I'm sorry, but I don't think I understand what you meant with your last post?

Frans Bouma | Lead developer LLBLGen Pro
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 14-Oct-2013 16:59:20   

Otis wrote:

I'm sorry, but I don't think I understand what you meant with your last post?

I mean in interchanged statements as below


public static DataTable TitleView1(string description)
        {
            Filter.Clear();
            _sort = null;
            var titleview = new TitleViewTypedList();
            Filter.Add(new FieldLikePredicate(TitleFields.Description.SetObjectAlias("T"),
                                                     ChangeCaseClass.Cleanstring("%" + description + "%")));
            Filter.AddWithAnd(new FieldCompareValuePredicate(TitleFields.Flag.SetObjectAlias("T"), ComparisonOperator.Equal,
                                                      PublicConstantClass.Validflag));
            _sort =
                new SortExpression(TitleFields.Description.SetObjectAlias("T") | SortOperator.Ascending);
            titleview.Fill(0, _sort, true, Filter);
            return titleview;
        }

Now I need to set CaseSensitiveCollation=true for the field title.description

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Oct-2013 21:45:16   
public static DataTable TitleView1(string description)
        {
            var likePredicate = new FieldLikePredicate(TitleFields.Description.SetObjectAlias("T"),
                                                     ChangeCaseClass.Cleanstring("%" + description.ToUpper() + "%"))

            likePredicate.CaseSensitiveCollation = true;

            Filter.Clear();
            _sort = null;
            var titleview = new TitleViewTypedList();
            Filter.Add();
            Filter.AddWithAnd(new FieldCompareValuePredicate(TitleFields.Flag.SetObjectAlias("T"), ComparisonOperator.Equal,
                                                     PublicConstantClass.Validflag));
            _sort =
                new SortExpression(TitleFields.Description.SetObjectAlias("T") | SortOperator.Ascending);
            titleview.Fill(0, _sort, true, Filter);
            return titleview;
        }

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 15-Oct-2013 06:50:49   

Walaa wrote:

public static DataTable TitleView1(string description)
        {
            var likePredicate = new FieldLikePredicate(TitleFields.Description.SetObjectAlias("T"),
                                                     ChangeCaseClass.Cleanstring("%" + description.ToUpper() + "%"))

            likePredicate.CaseSensitiveCollation = true;

            Filter.Clear();
            _sort = null;
            var titleview = new TitleViewTypedList();
            Filter.Add();
            Filter.AddWithAnd(new FieldCompareValuePredicate(TitleFields.Flag.SetObjectAlias("T"), ComparisonOperator.Equal,
                                                     PublicConstantClass.Validflag));
            _sort =
                new SortExpression(TitleFields.Description.SetObjectAlias("T") | SortOperator.Ascending);
            titleview.Fill(0, _sort, true, Filter);
            return titleview;
        }

Thank You Sir!