Avatar of cdemott33
Flag for United States of America asked on

Empty Business Object when Configure ObjectDataSource

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

ASP.NETVisual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Nasir Razzaq

8/22/2022 - Mon

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!
Your help has saved me hundreds of hours of internet surfing.
Nasir Razzaq

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question