Can someone tell me the difference in the following two LINQ statements?
var ChkUnique = DB.BusinessFile.FirstOrDefault(c => c.ROCNo == txtBoxID.Text);
and
var ChkUnique = from c in DB.BusinessFile where c.ROCNo == (string)txtBoxID.Text select c;
ChkUnique != null returns false for the top when a match cannot be found, and true for the last, and I cannot understand why this is happening.
I am new to LINQ, so I could have missed something really basic, but at the same time it made me crazy.
c # linq
Permas
source share