This is a migrated thread and some comments may be shown as answers.

What is an alternative for EntityDataSource?

2 Answers 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oleg
Top achievements
Rank 1
Oleg asked on 28 Oct 2010, 03:49 PM
I am using Entity Framework 4.0 + EntityDataSource + RadGrid on my pages and I got
Server Error in '/' Application.
--------------------------------------------------------------------------------
  
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  
Source Error: 
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
Stack Trace: 
  
  
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
   System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
   System.Reflection.RuntimeModule.GetTypes() +4
   System.Reflection.Assembly.GetTypes() +78
   System.Data.Metadata.Edm.ObjectItemConventionAssemblyLoader.LoadTypesFromAssembly() +75
   System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load() +42
   System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData) +233
   System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors) +162
   System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) +648
   System.Data.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) +78
   System.Data.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action`1 logLoadMessage) +119
   System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action`1 logLoadMessage) +124
   System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly) +39
   System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() +1109
   System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +164
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +96
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +212
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +127
   Telerik.Web.UI.GridTableView.DataBind() +364
   Telerik.Web.UI.RadGrid.DataBind() +173
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +108
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +130
   System.Web.UI.Control.EnsureChildControls() +162
   Telerik.Web.UI.GridBaseDataList.get_Controls() +33
   Telerik.Web.UI.RadAjaxControl.PopulatePlainPanels(Control parent, List`1 list, Control root) +119
   Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e) +1808
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +124
   System.Web.UI.Control.PreRenderRecursiveInternal() +185
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4771
    
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

I spend a lot of time on google and I found this issue happens same time and no solution for that. But pages where I do not use EntityDataSource work fine. What is an alternative for EntityDataSource if I need to edit data in RadGrid?

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 01 Nov 2010, 12:36 PM
Hello Oleg,

I suspect that recycle of the application pool will help in resolving this issue. It happens from time to time when working with EF.

As alternative you can use any other DataSourceControl or manual CRUD operations with RadGrid.

All the best,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dan
Top achievements
Rank 1
answered on 02 Mar 2011, 03:38 PM
Take a look at this post on Microsoft Connect: http://connect.microsoft.com/VisualStudio/feedback/details/541962/unable-to-load-one-or-more-of-the-requested-types-connected-with-entitydatasource

What worked for me was adding ContectTypeName to the EntityDataSource. For example, ContextTypeName="CMRPemployees.Data_Access.dbCMRP_EmployeesEntities" 

Dan

Tags
Grid
Asked by
Oleg
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Dan
Top achievements
Rank 1
Share this question
or