The type specified in the TypeName property of ObjectDataSource could not be found error
I was coding away happily developing a custom Reporting Services report for a SharePoint Web Part. The Web Part hosts a local Reporting Services report (.rdlc) and it’s using an ObjectDataSource as the data source, and I was getting the type specified in the TypeName property of ObjectDataSource could not be found error.
So in my code I have a data class with a select method, so my constructor looks like this:
ObjectDataSource ds = new ObjectDataSource(“MyNameSpace.MyClass”, “GetObjects”);
However, when executing the report, I got this error:
The type specified in the TypeName property of ObjectDataSource ” could not be found
I had put my assembly in the SafeControl section in Web.config, and the assembly was in the GAC.
It turns out that it also needs to be referenced in the <assemlbies> list of the <compiliaton> section, like this:
<compilation batch=”false” debug=”false”>
<add assembly=”MyAssembly, Version=126.96.36.199, Culture=neutral, PublicKeyToken=123456789ABCDEF” />
And now it worked.
5 thoughts to “How to fix the The type specified in the TypeName property of ObjectDataSource could not be found error in a SharePoint custom solution”
Thanks! You saved my day. 🙂
Excellent. But how would you deploy this as part of a package?
Would you need to write a feature that manually alters the web.config?
Tnx. Saved me many more hours of try and fail 🙁
Oh my post is corrupted
I mean this: