Linq to Sql case insensitive equality -


I'm reading contradictory explanations from Linq on Sql string comparisons.

When I do the following: / P>

  from d in p People where p.UserName = Select username P  

user name = "Johan"

I'm right, the case is insensitive, whether Linq is doing it by default or Is this happening in the SQL database?

I think you get conflicting results, indicates your db variable points and Where the comparison is actually executed. If it can, linq will generate the query and send it to the SQL Server. It seems that you can make the case insensitive by calling

  where p.UserName.ToLower () = username ToLower ()  

Comments

Popular posts from this blog

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

iphone - How do I make a UIPickerView in a UIActionSheet -