Print Page | Close Window

Yet another error in 6.0.7.0

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2375
Printed Date: 14-May-2026 at 7:53am


Topic: Yet another error in 6.0.7.0
Posted By: jocker1331
Subject: Yet another error in 6.0.7.0
Date Posted: 14-Dec-2010 at 11:17am

   в System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)
   в System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)
   в IdeaBlade.Windows.EntityQueryPagedCollectionView.BuildOrderedQuery()
   в IdeaBlade.Windows.EntityQueryPagedCollectionView.DoInitialLoad()
   в IdeaBlade.Windows.EntityQueryPagedCollectionView.Refresh()
   в IdeaBlade.Windows.ObjectDataSource.LoadView()
   в IdeaBlade.Windows.ObjectDataSource.LoadCore()
   в IdeaBlade.Windows.ObjectDataSource.ObjectDataSource_Loaded(Object sender, RoutedEventArgs e)
   в MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   в MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

Exception text like: "There is no 'ThenBy' method in System.Linq.Queriable that can deal with same arguments.

ProblemDetails:

//resiltFileDds is a ObjectDataSource: <ib:ObjectDataSource x:Name="infileDds" AutoLoad="False" PageSize="65000" LoadSize="65000"/>

  resiltFileDds.Query = (from resf in _dbCtx.ServiceTaskResultFileTemp
                                  join fd in _dbCtx.FileData on resf.FileDataId equals fd.Oid
                                  where fd.GCRecord == null && resf.ServiceTaskId == _someId
                                  orderby resf.ServiceTaskResultFileId   //!!
                                  select new DBTaskFileInfo  //this item shared (add as link) between SL and asp.net project
                                  {
                                     .....//see in logs//
                                  }).With(QueryStrategy.DataSourceOnly);

resiltFileDds.Load(); ....



Log:

Fetch ... value(IdeaBlade.EntityModel.EntityQueryProxy`1[CivilizationWeb.Models.ServiceTaskInitialFileTemp]).Join(value(IdeaBlade.EntityModel.EntityQueryProxy`1[CivilizationWeb.Models.FileData]), inf => inf.FileDataId, fd => Convert(fd.Oid), (inf, fd) => new _IB_f__AnonymousType3`2x2127173938() {inf = inf, fd = fd}).Where(<>h__TransparentIdentifier1 => ((<>h__TransparentIdentifier1.fd.GCRecord == null) AndAlso (<>h__TransparentIdentifier1.inf.ServiceTaskId == 305))).Select(<>h__TransparentIdentifier1 => new DBTaskFileInfo() {FileName = <>h__TransparentIdentifier1.fd.FileName, Title = <>h__TransparentIdentifier1.inf.Name, Oid = <>h__TransparentIdentifier1.fd.Oid, ServiceTaskId = <>h__TransparentIdentifier1.inf.ServiceTaskInitialFileId, Date = <>h__TransparentIdentifier1.inf.Date}).OrderByDescending(ti => ti.Date).ThenBy(Param_0 => Param_0.Oid).Take(65000)




Replies:
Posted By: kimj
Date Posted: 15-Dec-2010 at 11:33am
I'm surprised you got that far, since the ObjectDataSource does not generally handle anonymous projections or projections into a type well.   Since you did get this far, removing the orderby from your query and instead defining a SortDescriptor should get you past the problem.
 
I'm curious, though, why you want to use the ObjectDataSource.  If you don't need paging, and also apparently not grouping or filtering, it would probably be much easier to just load the query results directly into your grid and not bother with the ODS in the middle.


Posted By: jocker1331
Date Posted: 18-Dec-2010 at 3:02am
But this code work whell in 6.0.6 ....
"I'm curious, though, why you want to use the ObjectDataSource" - why not?
"If you don't need paging" - i copy&paste only example and my app need paging, groupping, etc.



Print Page | Close Window