Link to home
Start Free TrialLog in
Avatar of cdemott33
cdemott33Flag 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.  
User generated image
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
        Get
            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

Avatar of BuggyCoder
BuggyCoder
Flag of India image

Your business object needs to include a method that returns a DataSet object in order to display data in a Web server control

http://msdn.microsoft.com/en-us/library/1se6685s%28v=vs.80%29.aspx
Avatar of cdemott33

ASKER

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!

User generated image
It has something to do with my other project file?  I just don't know what?  Please help!
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial