Print Page | Close Window

LinqDataSource

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=750
Printed Date: 30-Sep-2020 at 1:10am


Topic: LinqDataSource
Posted By: danielp37
Subject: LinqDataSource
Date Posted: 31-Mar-2008 at 10:13pm
I am trying to use a LinqDataSource to query one of my Entity Sets in my Entity Manager and I have it setup to go through the BOS.  I have been able to get a similar query to work using the LINQ to Entities directly within my ASP.NET app, but when I try to access a page that uses the LinqDataSource, I get the following error:

Exception Details: System.ServiceModel.FaultException: Could not load file or assembly 'DynamicClasses, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Stack Trace:

[FaultException: Could not load file or assembly 'DynamicClasses, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
IdeaBlade.EntityModel.v4.RemoteEntityServerProxy.CheckConnection(Exception pException) +161
IdeaBlade.EntityModel.v4.EntityServerProxy.Fetch(SessionBundle pBundle, IEntityQuery pQuery) +114
IdeaBlade.EntityModel.v4.EntityManager.ExecuteServerQuery(IEntityQuery pEntityQuery) +77

[EntityServerException: Could not load file or assembly 'DynamicClasses, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
IdeaBlade.EntityModel.v4.EntityManager.HandleEntityServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation) +190
IdeaBlade.EntityModel.v4.EntityManager.ExecuteServerQuery(IEntityQuery pEntityQuery) +105
IdeaBlade.EntityModel.v4.EntityManager.ExecuteFetch(IEntityFinder finder) +182
IdeaBlade.EntityModel.v4.EntityQueryFinder.Execute() +311
IdeaBlade.EntityModel.v4.EntityManager.ExecuteQueryCore(IEntityQuery query, QueryStrategy strategy) +236
IdeaBlade.EntityModel.v4.EntityManager.ExecuteQueryForScalar(IEntityQuery query, QueryStrategy strategy) +37
IdeaBlade.EntityModel.v4.EntityManager.ExecuteQueryForScalar(IEntityQuery query) +32
IdeaBlade.EntityModel.v4.EntityQuery`1.Execute(Expression expression) +260
System.Web.Query.Dynamic.DynamicQueryable.Count(IQueryable source) +139
System.Web.UI.WebControls.DynamicQueryableWrapper.Count(IQueryable source) +6
System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelectAutoSortAndPage(IQueryable source, DataSourceSelectArguments arguments) +127
System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelectQuery(LinqDataSourceSelectEventArgs selectEventArgs, Object selectResult, Object table, Boolean storeOriginalValues) +308
System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +482
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041

Does anybody have any idea what this error is about and how I might fix it?  I don't have any assembly called DynamicClasses so I don't know why its trying to reference it.

Thanks,

Dan



Replies:
Posted By: danielp37
Date Posted: 02-Apr-2008 at 7:40pm
I figured out a workaround for the error that I was getting.  I originally had the LinqDataSource declared as:

<asp:LinqDataSource ID="LinqDataSource1" runat="server"
            ContextTypeName="HEDataIB.HEDataSet" OrderBy="Name_LastName, Name_FirstName"
            Select="new (MemberId, Name_LastName, Name_FirstName, CipStatus, CipScore, Gender)"
            TableName="Members" Where="CipStatus == @CipStatus">
            <WhereParameters>
                <asp:Parameter DefaultValue="Failed" Name="CipStatus" Type="String" />
            </WhereParameters>
        </asp:LinqDataSource>

and that was causing me to get the above error.  But if i remove the "Select" phrase, it works correctly.



Print Page | Close Window