InvalidOperationException / NotSupportedException

InvalidOperationException / NotSupportedException

Postby MartinJJ » Fri 09 Apr 2010 04:22

Hi,

I am attempting to port an existing app that makes use of Linq and Sqlserver. I need to port this to Oracle. I have made a few attempts at getting this to work.

The following error comes from a compiledquery. I would really appreciate any thoughts you might have on what is not working here and whether there is any prospect of it doing so.

Is there any sytax not supported here or something?

Regards

Martin

{"Cannot use \"\" type value in \"Decimal\" type argument"}


The LambdaExression:


Code: Select all
{ga => ga.Groups.Join(ga.Groups.GroupBy(g => new <>f__AnonymousType0`2(GRP_GROUP = g.GRP_GROUP, GRP_SPEC = g.GRP_SPEC), g => g.GRP_INH_DEPTH).Select(t => new <>f__AnonymousType1`3(GRP_GROUP = t.Key.GRP_GROUP, GRP_SPEC = t.Key.GRP_SPEC, MAX_DEPTH = t.Max())), grp => new <>f__AnonymousType0`2(GRP_GROUP = grp.GRP_GROUP, GRP_SPEC = grp.GRP_SPEC), g => new <>f__AnonymousType0`2(GRP_GROUP = g.GRP_GROUP, GRP_SPEC = g.GRP_SPEC), (grp, g) => new <>f__AnonymousType2`2(grp = grp, g = g)).Where(<>h__TransparentIdentifier0 => ((<>h__TransparentIdentifier0.grp.GRP_INH_DEPTH = 0) || (<>h__TransparentIdentifier0.grp.GRP_INH_DEPTH = 1))).GroupBy(<>h__TransparentIdentifier0 => new <>f__AnonymousType1`3(GRP_GROUP = <>h__TransparentIdentifier0.grp.GRP_GROUP, GRP_SPEC = <>h__TransparentIdentifier0.grp.GRP_SPEC, MAX_DEPTH = <>h__TransparentIdentifier0.g.MAX_DEPTH), <>h__TransparentIdentifier0 => (<>h__TransparentIdentifier0.grp.GRP_INH_DEPTH * <>h__TransparentIdentifier0.grp.GRP_ANCESTOR)).OrderBy(t => t.Key.GRP_GROUP).ThenBy(t => t.Key.MAX_DEPTH).Select(t => new InheritanceTriplet(t.Key.GRP_GROUP, t.Key.GRP_SPEC, t.Max()))}


The Query:

Code: Select all
inheritance_query = Devart.Data.Linq.CompiledQuery.Compile(
                (GAORCL2.GAORCL2 ga) =>
                    from grp in ga.Groups
                    join g in
                        (
                            from g in ga.Groups
                            group g.GRP_INH_DEPTH by new { g.GRP_GROUP, g.GRP_SPEC } into t
                            select new { t.Key.GRP_GROUP, t.Key.GRP_SPEC, MAX_DEPTH = t.Max() }
                            ) on new { grp.GRP_GROUP, grp.GRP_SPEC } equals
                         new { g.GRP_GROUP, g.GRP_SPEC }
                    where grp.GRP_INH_DEPTH == 0 || grp.GRP_INH_DEPTH == 1
                    group grp.GRP_INH_DEPTH * grp.GRP_ANCESTOR by
                        new { grp.GRP_GROUP, grp.GRP_SPEC, g.MAX_DEPTH }
                        into t
                        orderby t.Key.GRP_GROUP, t.Key.MAX_DEPTH
                        select new InheritanceTriplet(t.Key.GRP_GROUP, t.Key.GRP_SPEC, t.Max())
            );


The Stack Trace:
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.CheckConversionToParameterType(SqlExpression argumentValue, Type parameterType)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ac A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ac A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ac A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.g(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.d(ak A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ak A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(ad A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(ad A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(bb A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(bb A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.c(SqlExpression A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(am A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(SqlNode A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.e(x A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(x A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
    at Devart.Data.Linq.Provider.Query.DbMethodCallConverter.a(f A_0)
    at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
    at Devart.Data.Linq.Provider.DataProvider.a(e 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.i(Expression A_0)
    at Devart.Data.Linq.CompiledQuery.a(b A_0)
    at Devart.Data.Linq.CompiledQuery.a(DataContext A_0, Object[] A_1)
    at Devart.Data.Linq.CompiledQuery.Invoke[a,b](a A_0)
    at Grads.Groups_ORCL.list(GAORCL2 ga) in D:\Martin\devart\devartTest\devartTest\Groups_ORCL.cs:line 65
    at devartTest.Program.Main(String[] args) in D:\Martin\devart\devartTest\devartTest\Program.cs:line 31
    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
Last edited by MartinJJ on Fri 09 Apr 2010 12:11, edited 1 time in total.
MartinJJ
 
Posts: 14
Joined: Thu 08 Apr 2010 10:55

Postby MartinJJ » Fri 09 Apr 2010 11:58

Hi,

Syntax wise there is nothing wrong.

What I really need to know is if this product will handle this if there is not a practical workaround.

The query as it stands work fine with sqlserver though this error is raised. Is there anyone from devart able to comment please. As i mentioned a guranteed sale if we get this working.

Martin
MartinJJ
 
Posts: 14
Joined: Thu 08 Apr 2010 10:55

Postby AndreyR » Fri 09 Apr 2010 17:08

You can find a reply to your inquiry here:
http://www.devart.com/forums/viewtopic.php?t=17587
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle