View Single Post
  #5 (permalink)  
Old November 11th, 2008, 09:10 AM
dpkbahuguna dpkbahuguna is offline
Friend of Wrox
Join Date: Jan 2006
Location: Hardwar, Uttranchal, India.
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna

Ya thanks to reply Old Pedant,

      using LINQ i have done it..but just wanted to know why is it not running as I was comparing it.

Thanks again.

quote:Originally posted by Old Pedant
 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.