View Single Post
  #4 (permalink)  
Old November 11th, 2008, 03:56 AM
Old Pedant Old Pedant is offline
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Ahhh...makes eminent sense, now.

I think I also got hung up on the inefficiency of the SQL query. Doing toLowerCase() on a field in SQL pretty much guarantees that you can't get the best performance if the field in question is indexed. Since most SQL operations are case-insensitive, you'd be much better off with

var Qry = from x in FI where x LIKE fname+'%' select x;

Assuming that's legal LINQ syntax. But in any case, finding a way to use LIKE would presumably give better efficiency. Clearly wouldn't give worse.