ObjectDataSource TypeName

Came across an issue when trying to connect an ObjectDataSource control to a SharePoint 2010 SPGridView earlier where page threw an Exception on the TypeName parameter which was in the format [namespace.classname]. Interestingly using a code based ObjectDataSource worked fine. After some trial and error (mainly error) I found a solution (this assumes a safecontrols entry already exists) either:

  1. Add an entry to the system.web > compilation > assemblies
  2. For the TypeName use the fully qualified name (get it with reflector) in the form “namespace.classname, dllname, version, culture, publickeytoken
Hope this saves someone else as much time as I wasted!

Leave a Reply

Your email address will not be published. Required fields are marked *