Searching in LLblgen

Posts   
 
    
rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 21-Dec-2007 01:13:27   

Can some help me out in this please:

i can search with firstname and surname seperately but how to merge two fields and then do the search. at the moment iam doing like this: static public EntityCollection SearchName(string name) { DataAccessAdapter adapter = new DataAccessAdapter(dbConnectionString()); EntityCollection namesearch = new EntityCollection(new MemberEntityFactory()); String Name1 = "%" + name + "%"; IRelationPredicateBucket bucket = new RelationPredicateBucket(MemberFields.Surname % Name1 | MemberFields.Firstname % Name1 ); ISortExpression sort = new SortExpression(); sort.Add(MemberFields.ClubId | SortOperator.Ascending); adapter.FetchEntityCollection(namesearch, bucket, 0, sort); adapter.Dispose(); return namesearch; }

My question is that i want to search by full name. I want to add firstname and surname then do the search. Can anyone help me in this please....... hope iam posting in the right section.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Dec-2007 10:53:15   

Maybe you will need something like the following:

            Expression someExp = new Expression(" ", ExOp.Add, MemberFields.Surname);
            Expression fullExp = new Expression(MemberFields.Firstname, ExOp.Add, someExp);
            IRelationPredicateBucket bucket = new RelationPredicateBucket(MemberFields.Surname.SetExpression(fullExp) % Name1 );
rai
User
Posts: 41
Joined: 25-Jan-2007
# Posted on: 23-Dec-2007 09:08:43   

thanks..i managed to get it.