Hey,

I'm creating a web application with the use of a ObjectDataSource. When I try to run the webapp i get the following error:

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

[InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource1' could not be found.]
   System.Web.UI.WebControls.ObjectDataSourceView.GetType(String typeName) +1122339
   System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1171
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   System.Web.UI.WebControls.GridView.DataBind() +4
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

It seems that the ObjectDataSource can not find the object I use. But I Assure you, it is there. The Object is created in the App_Code folder and is completely tested without the ObjectDataSource object.

I referr to this object like this.

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataTable" 
            TypeName="namespace.theObject"></asp:ObjectDataSource>
        <br />
        <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1">
        </asp:GridView>

I hope anyone can tell me what I am doing wrong.

Parameter's property TypeName is missing or somewhat it uses different class name which is not available in your application.

I have figured it out. I was running the webpage as Virtual Directory. I needed to use an application

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.