Here string productname2="xyz" but actually in database PRODUCTNAME is "XYZ" when I compare it return false,so I could not get productcode,here I want not only compare but also some value from this satetement.
orderdetail.PRODUCTCODE = context.PRODUCTs.Where(pro => pro.PRODUCTNAME==productname2)
.Select(code => code.PRODUCTCODE).DefaultIfEmpty().Max();
Any help will be appreciated