New Posts New Posts RSS Feed: Yet another error in 6.0.7.0
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Yet another error in 6.0.7.0

 Post Reply Post Reply
Author
jocker1331 View Drop Down
Newbie
Newbie


Joined: 11-Dec-2010
Posts: 5
Post Options Post Options   Quote jocker1331 Quote  Post ReplyReply Direct Link To This Post Topic: Yet another error in 6.0.7.0
    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)

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
jocker1331 View Drop Down
Newbie
Newbie


Joined: 11-Dec-2010
Posts: 5
Post Options Post Options   Quote jocker1331 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down