I'm going to ask a very basic question but since I'm getting this problem and I'm not getting why this is happening. Usually when we compare two strings like s1==s2 , it compares with length, characters, cases etc but while working in linq with the following query it is not matching the cases of the string. My DB has Password123 but when I enter password123, then also it return me a record which is actually wrong.
My query is:
var row = DB.tbllogin.Where(m => m.Id == LoginId && m.Password ==
pwd.Trim()).FirstOrDefault();
It is not matching the cases.The field in DB is of nvarchar type and pwd is of string type and I am using Entity Framework ORM.