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.