IsNullOrEmpty method not supported

IsNullOrEmpty method not supported

Postby dilbert » Wed 24 Jun 2009 10:14

Hi,

I got the following exception with dotConnect for MySql 5.20.33:

Code: Select all
Method 'Boolean IsNullOrEmpty(System.String)' is not supported for execution as SQL.

   at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
   at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(bo A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ax A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
   at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(au A_0)
   at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(au A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
   at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
   at Devart.Data.Linq.Provider.Query.SqlFormatter.a(SqlNode A_0, CommandType& A_1)
   at Devart.Data.Linq.Provider.DataProvider.a(c A_0, Type A_1, SqlNode A_2, IList`1 A_3)
   at Devart.Data.Linq.Provider.DataProvider.a(Expression A_0)
   at Devart.Data.Linq.Provider.DataProvider.h(Expression A_0)
   at Devart.Data.Linq.DataQuery`1.i()
   ...


for the following query:

Code: Select all
(from eq in DB.ExamQuestions
where String.IsNullOrEmpty(eq.Question)
select eq).ToList();


I'm not sure if this method is not supported at all or if it is just a bug in dotConnect for MySql.
Thanks in advance.
dilbert
 
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Postby AndreyR » Wed 24 Jun 2009 11:28

We will investigate the possibility of adding this functionality.
As a temporary workaround you can use the (eq.Question == null)||(eq.Question == "") comparison.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Wed 01 Jul 2009 14:23

This problem is fixed. Look forward to the next build.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to LinqConnect (LINQ to SQL support)