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
Post a Comment