Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> case-insensitive search
 

Pages: 1
LLBLGen Pro Runtime Framework
case-insensitive search
Page:1/1 

  Print all messages in this thread  
Poster Message
Rhywun
User



Location:
NYC
Joined on:
05-Jan-2005 02:17:57
Posted:
44 posts
# Posted on: 17-Sep-2007 20:34:10.  
I always allow the user to perform case-insensitive searches on my sites, and while I know how to do this in the generated code, I wonder if there's a more concise way. For example I started with this:

Code:
filter.AddWithOr(PersonFields.LastName % likeValue);


When I realized I needed to specify case-insensitivity, I wound up writing this:

Code:
predicate = new FieldLikePredicate(PersonFields.LastName, likeValue);
predicate.CaseSensitiveCollation = true;
filter.AddWithOr(predicate);


Ideally I'd like a way to specify case-insensitivity using the short form -- I think it would make my code more readable. Plus I filter on a lot of fields.
Self-Servicing, LLBLGenPro v. 2.5.0.0
ORMSupportClasses.NET20.dll v. 2.5.0.0
.NET v. 2.0.50727, VS v. 8.0.50727.51
 
Top
goose
User



Location:
Central America
Joined on:
06-Aug-2007 18:21:05
Posted:
385 posts
# Posted on: 17-Sep-2007 21:24:45.  
I think that your are already doing it the best way possible. By the way I think the correct line would be:
Code:
predicate = new FieldLikePredicate(PersonFields.LastName, likeValue.ToUpper());

becasue the CaseSensitiveCollation property, when set to true, would use the UPPER() function equivalent in your db.

Cheers,


gansodesoya  Top
Rhywun
User



Location:
NYC
Joined on:
05-Jan-2005 02:17:57
Posted:
44 posts
# Posted on: 17-Sep-2007 22:10:36.  
goose wrote:
I think that your are already doing it the best way possible.


OK. Perhaps I will request a feature in another section of the forum Regular Smiley
Or maybe roll my own...

goose wrote:
By the way I think the correct line would be


Thanks--I remembered that after I watched it fail the first time Regular Smiley
Self-Servicing, LLBLGenPro v. 2.5.0.0
ORMSupportClasses.NET20.dll v. 2.5.0.0
.NET v. 2.0.50727, VS v. 8.0.50727.51
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.