1

Possible Duplicate:
linq to entities case sensitive comparison

See image below can you help why it is getting user record. If I am not wrong entity framework is case sensative I am passing value with small letter but it is still fetching record. Why it is fetching record? :(

enter image description here

Community
  • 1
  • 1
SOF User
  • 7,590
  • 22
  • 75
  • 121
  • 6
    Please tell me the data in the screenshot is mock data and you didn't just post this poor guy's email (and a password) to SO... – Chris Shain Jan 08 '12 at 18:49
  • this is sample data its not real email and even not correct password – SOF User Jan 08 '12 at 18:52
  • OK, cool, thanks! Always a good thing to note. – Chris Shain Jan 08 '12 at 18:53
  • 2
    Dup: [linq to entities case sensitive comparison](http://stackoverflow.com/questions/3843060/linq-to-entities-case-sensitive-comparison). I don't understant negative votes for this question. Some one can explain it! – dani herrera Jan 08 '12 at 18:56
  • Could you please be more specific on the way you are fetching the record? Could you send us this piece of code? – Veronica Jan 08 '12 at 18:55
  • User user = new ForeverWordsDBEntities().Users.Include("Country").Where(x => x.LoginId.ToLower().Trim() == LoginId.ToLower().Trim() && x.Password == Password && x.IsDisabled == false).SingleOrDefault(); – SOF User Jan 08 '12 at 18:57

1 Answers1

5

Is it possible that the database that you are querying is using a case-insensitive coallation? In that case, SQL Server itself, not EF, would be ignoring case.

Chris Shain
  • 50,833
  • 6
  • 93
  • 125