Q:

Why do I receive the error "The data object type specified in the DataObjectTypeName property of ObjectDataSource 'ods' could not be found"?

I have an ObjectDataSource on an ASP.NET WebForms page, that also has a data-bound control. The declarative syntax for the ODS looks like this:
<asp:ObjectDataSource runat="server" ID="ods"
    TypeName="Transaction"
    SelectMethod="GetTransactionList"
    SelectCountMethod="GetTransactionListCount"
    DataObjectTypeName="Transaction.TransactionViewModel"
    UpdateMethod="UpdateTransaction"
    >
</asp:ObjectDataSource>

Data is successfully retrieved from the data source; however, when an Update operation is attempted, this error occurs:

The data object type specified in the DataObjectTypeName property of ObjectDataSource 'ods' could not be found

The type Transaction.TransactionViewModel is public, and it is visible from the code-behind of this page. Why can't the ObjectDataSource find it?

A:

Your type specification is incorrect for an inner class. To specify an inner class, you need to use +, not ., this:
DataObjectTypeName="Transaction+TransactionViewModel"

