String.IsNullOrEmpty in LINQ To SQL query?

Curiously, per MSDN String.IsNullOrEmpty is supported (by virtue of it not being unsupported), yet I can only find complaints about it not being supported.

However, if it does work you should not explicitly compare it to a boolean value, instead:

var results = from result in context.Records
          /*XXX broke :( where !String.IsNullOrEmpty(result.Info) */
          where !(result.Info == null || result.Info.Equals(""))
          select result;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)