Empty Business Object when Configure ObjectDataSource

cdemott33 used Ask the Experts™
I would like to bind an ObjectDataSource control in my page to a method of one of the existing classes in my App_Code folder. However, when I go "Configure Data Source..." for this control, the wizard shows an empty drop-menu for business object, and I can't choose any of my classes.

I'm not sure how to fix this.  
Here's my class...

Imports Microsoft.VisualBasic
Imports ReportDALTableAdapters

<System.ComponentModel.DataObject()> _
Public Class Report_ResultsBLL

    Private _adaptor As QuestionnaireResultsTableAdapter = Nothing
    Protected ReadOnly Property Adaptor() As QuestionnaireResultsTableAdapter
            If _adaptor Is Nothing Then
                _adaptor = New QuestionnaireResultsTableAdapter()
            End If

            Return _adaptor
        End Get
    End Property

    <System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, True)> _
    Public Function GetAttendeeVisitorRoleCount(ByVal EventID As Integer, ByVal QuestionID As Integer) As ReportDAL.QuestionnaireResultsDataTable
        Return Adaptor.GetAttendeeVisitorRoleCount(EventID, QuestionID)
    End Function
End Class

Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Your business object needs to include a method that returns a DataSet object in order to display data in a Web server control



I don't think that's it.  I opened a previous project that was working and now I'm getting the same exact error.  I *think* is a Visual Studio issue?  Any other thoughts?


Hi BuggyCoder, As a test I did the following

1. Created a new website in Visual Studio
2. Created the App_Code folder
3. Created a class file called MyBLLClass.vb
4. Wrote the following:

Imports Microsoft.VisualBasic
Imports System.Data

<System.ComponentModel.DataObject(True)> _
Public Class MyBLLClass

End Class

Open in new window

5. Drop and ObjectDataSource on the page and click "Configure Data Source"

Bingo!  It's sees MyBLLClass!

It has something to do with my other project file?  I just don't know what?  Please help!
Most Valuable Expert 2012
Top Expert 2014
In your original code, you have

<System.ComponentModel.DataObject()> _

In your test project, you have

<System.ComponentModel.DataObject(true)> _

This boolean is what indicates that this class is suitable to be used with a ObjectDataSource so add True to your original class.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial