Not sure if this is the best way to achieve this in Linq.
I am trying to select Contacts entries in CRM 2011, where EMailAddress1 contains a value. The following WHERE clauses I tried both threw exceptions:
Where c.EMailAddress1 > ""
Where Not String.IsNullOrEmpty(c.EMailAddress1)
So, I ended up trying to do this, which seems to work fine:
Where Not c.EMailAddress1.Equals(String.Empty) _
And Not c.EMailAddress1.Equals(Nothing)
But I'm just not sure if this is the most effective method. It is not very elegant. Is there an easier way to check if a row column has a value?
source
share