Click here to Skip to main content
15,947,389 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,
I have a problem, I have a Web Application project, I use object data source, locally, It work correctly and carefully but when I published , I got a error:

The type specified in the TypeName property of ObjectDataSource 'ProductsObjectDataSource' could not be found.

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.InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'ProductsObjectDataSource' could not be found.

VB
[InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'ProductsObjectDataSource' could not be found.]
   System.Web.UI.WebControls.ObjectDataSourceView.GetType(String typeName) +2883054
   System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1806
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +176
   System.Web.UI.WebControls.ListControl.PerformSelect() +51
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +146
   System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +36
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297



How can I fixed it?

Thanks
Posted
Updated 15-Oct-19 10:20am

I solved it, I put DataSet in the app_code, then object data source couldn't find DataSet, when I put it in the root, It works correctly.
 
Share this answer
 
You can also append the namespace to the TypeName
as in TypeName="MyNameSpace.ProductsObjectDataSource"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900