I am getting this error while using entity data source. Server Error in '/' Application.
Unable to cast object of type 'System.Web.UI.WebControls.EntityDataSourceView' to type 'System.Web.UI.WebControls.QueryableDataSourceView'.
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.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.EntityDataSourceView' to type 'System.Web.UI.WebControls.QueryableDataSourceView'.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:
[InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.EntityDataSourceView' to type 'System.Web.UI.WebControls.QueryableDataSourceView'.]
Infragistics.Web.UI.Framework.Data.QueryableDataSourceControlAdapter.AdjustSelectArguments(DataSourceSelectArguments arguments, DataSourceView dataSourceView) +85
Infragistics.Web.UI.Framework.Data.DataSourceControlAdapter.InitSchema(DataSourceSelectArguments arguments) +116 Infragistics.Web.UI.Framework.Data.DataSourceAdapter.Select(DataSourceSelectArguments arguments) +96 Infragistics.Web.UI.Framework.Data.DataSourceObjectView.ExecuteSelect(DataSourceSelectArguments arguments) +72 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74 Infragistics.Web.UI.GridControls.WebDataGrid.DataBind() +835 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.EnsureDataBound() +86 Infragistics.Web.UI.GridControls.WebDataGrid.EnsureDataBound() +186 Infragistics.Web.UI.GridControls.WebDataGrid.CreateChildControls() +51 System.Web.UI.Control.EnsureChildControls() +102 Infragistics.Web.UI.GridControls.WebDataGrid.EnsureChildControls() +128 System.Web.UI.Control.PreRenderRecursiveInternal() +42 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
Hi,
This bug is resolved. Thanks for bringing it to our attention!
I would also like some additinal information about what was fixed, as I am getting a very similar error:
Unable to cast object of type 'System.Web.UI.WebControls.EntityDataSourceView' to type 'System.Web.UI.WebControls.QueryableDataSourceView'. ---> System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.EntityDataSourceView' to type 'System.Web.UI.WebControls.QueryableDataSourceView'. at Infragistics.Web.UI.Framework.Data.QueryableDataSourceControlAdapter.AdjustSelectArguments(DataSourceSelectArguments arguments, DataSourceView dataSourceView) at Infragistics.Web.UI.Framework.Data.DataSourceControlAdapter.InitSchema(DataSourceSelectArguments arguments) at Infragistics.Web.UI.Framework.Data.DataSourceAdapter.Select(DataSourceSelectArguments arguments) at Infragistics.Web.UI.DataSourceControls.WebHierarchicalDataSource.AddToCache(String id) at Infragistics.Web.UI.DataSourceControls.WebHierarchicalDataSource.GetCached(String id) at Infragistics.Web.UI.DataSourceControls.WebHierarchicalDataSourceView.Select() at Infragistics.Web.UI.Framework.Data.HierarchicalDataBot.GetHierarchicalData(IHierarchicalDataObject dataObject) at Infragistics.Web.UI.Framework.Data.HierarchicalDataBot.PerformDataBinding() at Infragistics.Web.UI.Framework.Data.HierarchicalDataBoundControlMain.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at Infragistics.Web.UI.Framework.Data.HierarchicalDataBoundControlMain.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
I am using the 2010.3 version (I updated today 03/22/2011.
Getting the error using the WebHierarchicalDataSource when using an EntityDataSource
Hi kgolding01,
It looks like you are using an EntityDataSource as a View in WebHierarchicalDataSource as the source for a WebHierarchicalDataGrid? And you're using 10.3? Was this a 1 level WHDG? Doing any behaviors? Let me know and I'll try to replicate it on my end.
thanks,Dave
I just created a support case for this: CAS-62772-GB0RZS
I am not sure what you mean by "Was this a 1 level WHDG"..
As for what I am doing, I am using the WebHierarchicalDataSource with an EntityData source to feed a WebDataTree. The nestling level is roughly 4-6 levels.
<asp:EntityDataSource ID="TrackableObjectEntityDataSource" runat="server" ConnectionString="name=TheEntities" DefaultContainerName="TheEntities" EntitySetName="TrackableObjects"> </asp:EntityDataSource> <ig:WebHierarchicalDataSource ID="TrackableObjectWebHierarchicalDataSource" runat="server"> <DataRelations> <ig:DataRelation ChildColumns="ParentId" ChildDataViewID="TrackableObjectEntityDataSource_DefaultView" ParentColumns="TrackableObjectId" ParentDataViewID="TrackableObjectEntityDataSource_DefaultView" /> </DataRelations> <DataViews> <ig:DataView ID="TrackableObjectEntityDataSource_DefaultView" DataMember="DefaultView" DataSourceID="TrackableObjectEntityDataSource" /> </DataViews> </ig:WebHierarchicalDataSource> <uc3:TrackableObjectHeader ID="TrackableObjectHeader1" runat="server" /> <div style="text-align: left; width: 367px; margin-left: auto; margin-right: auto"> <br /> Please select new parent: <ig:WebDataTree ID="TrackableObjectWebDataTree" runat="server" Height="300px" Width="367px" DataSourceID="TrackableObjectWebHierarchicalDataSource" onnodebound="TrackableObjectWebDataTree_NodeBound" SelectionType="Single" EnableExpandOnClick="True" InitialDataBindDepth="1" InitialExpandDepth="1"> <DataBindings> <ig:DataTreeNodeBinding DataMember="TrackableObjectEntityDataSource_DefaultView" TextField="Name" /> </DataBindings> </ig:WebDataTree> </div>
So your EntityDataSource is self-referencing. I would contact developer support to have them put together a working sample for this so that a bug can be submitted. If you can post one here, I would be glad to create a bug on your behalf.