How do i do ignore case in my where clause
Posted: Thu 15 Sep 2011 12:27
I have an issue in doing an ignore case comparision I have tried both .equal and .tolower() both of the methods does not get me the desired results.
Both of these fails to retrieve the results , what is the solution for this
.toUpper
var userArray = from users in userModelEntityContext.USERS_ONLINE
where users.USER_NAME.ToUpper() == username.ToUpper()
select users;
.equal
var userArray = from users in userModelEntityContext.USERS_ONLINE
where users.USER_NAME.Equals(username,StringComparison.OrdinalIgnoreCase)
select users;
Both of these fails to retrieve the results , what is the solution for this
.toUpper
var userArray = from users in userModelEntityContext.USERS_ONLINE
where users.USER_NAME.ToUpper() == username.ToUpper()
select users;
.equal
var userArray = from users in userModelEntityContext.USERS_ONLINE
where users.USER_NAME.Equals(username,StringComparison.OrdinalIgnoreCase)
select users;