linq2mysqlbeta: Method 'ToLower' in linq query does not work

linq2mysqlbeta: Method 'ToLower' in linq query does not work

Postby yuri@wallie.com » Mon 27 Oct 2008 10:06

Hi,

When i pass a CultureInfo in "ToLower" method in a linq query, i get the following exception: "Method 'ToLower' has no supported translation to SQL.".

Code example:

Code: Select all
CultureInfo ci = new CultureInfo("nl-NL");
var walnumbers = from w in db.Walnumbers.Where(w => w.Name.ToLower(ci).Contains(searchCriteria)


Stack Trace:

[NotSupportedException: Method 'ToLower' has no supported translation to SQL.]
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.g(MethodInfo A_0) +81
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.h(MethodInfo A_0) +5010
Devart.MySql.Linq.Provider.Query.MySqlMethodCallConverter.GetServerMethodsForMethod(MethodInfo m) +471
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ah A_0) +841
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +1867
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ah A_0) +161
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +1867
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.a(j A_0) +65
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(j A_0) +152
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +136
Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.c(h A_0) +144
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(h A_0) +528
Devart.Data.Linq.Provider.Query.SqlVisitor.a(a1 A_0) +130
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(a1 A_0) +112
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +2498
Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0) +36
Devart.Data.Linq.Provider.Query.SqlVisitor.c(h A_0) +88
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(h A_0) +528
Devart.Data.Linq.Provider.Query.SqlVisitor.a(a1 A_0) +130
Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(a1 A_0) +112
Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0) +2498
Devart.Data.Linq.Provider.DataProvider.a(b A_0, Type A_1, SqlNode A_2, ReadOnlyCollection`1 A_3) +251
Devart.Data.Linq.Provider.DataProvider.a(Expression A_0) +247
Devart.Data.Linq.Provider.DataProvider.f(Expression A_0) +168
Devart.Data.Linq.DataQuery`1.i() +53
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +247
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +81
umbrellaDataContext.Walnumber.GetByConditions(String searchCriteria, String walnumbertypePK) in C:\data\websites\umbrella.wallie.com\umbrellaDataContext\Walnumber.cs:20
_retailsettings_default.bindRetailers() in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:32
_retailsettings_default.bindData() in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:26
_retailsettings_default.Page_Load(Object sender, EventArgs e) in c:\data\websites\umbrella.wallie.com\umbrella.wallie.com\_retailsettings\default.aspx.cs:19
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
yuri@wallie.com
 
Posts: 27
Joined: Mon 08 Sep 2008 16:37

Postby Shalex » Thu 30 Oct 2008 12:17

We don't support the "ToLower" method with this parameter. Use another overload of this method.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL