Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 86739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:17:36+00:00 2026-05-10T22:17:36+00:00

Greetings! I’m creating a User Control that will display data in a GridView control.

  • 0

Greetings!

I’m creating a User Control that will display data in a GridView control. We are using n-tier architecture and the data in question is retrieved from our database and returned to us as a ReadOnlyCollection. OurNewObject is a class containing several properties and an empty constructor that takes no parameters – it’s in the following namespace: Acme.ObjectModel.

In the user control, I have the following:

<asp:GridView ID='ourGrid' runat='server' DataSourceID='ourDataSource'>     <columns>     <asp:BoundField DataField='Name' HeaderText='Full Name' />     <asp:BoundField DataField='Gender' HeaderText='Gender' />     <asp:BoundField DataField='BirthYear' HeaderText='Year of Birth' />     <asp:BoundField DataField='JoinDate' HeaderText='Date Joined' />   </columns> </asp:GridView> <asp:ObjectDataSource ID='ourDataSource' runat='server' SelectMethod='GetTopUsers' TypeName='Acme.Model.OurNewObject'> </asp:ObjectDataSource> 

In the User Control’s code behind, I have the following public method:

public ReadOnlyCollection<OurNewObject> GetTopUsers() {     return (OurDataProxy.GetJustTheTopUsers()); } 

When I place the User Control on a Web form and run it, I get the following message:

ObjectDataSource ‘ourDataSource’ could not find a non-generic method ‘GetTopUsers’ that has no parameters.

So my questions are:

  1. Am I using the ObjectDataSource incorrectly?
  2. Is there a more proper way to use the ObjectDataSource in this situation?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:17:37+00:00Added an answer on May 10, 2026 at 10:17 pm

    I believe the issue is missing two attributes.

    First on your GetTopUsers() Method add this attribute

    [System.ComponentModel.DataObjectMethodAttribute     (System.ComponentModel.DataObjectMethodType.Select, true)] 

    Then on the actual OurNewObject class add this attribute

    [System.ComponentModel.DataObject] 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 81k
  • Answers 81k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the OUTPUT functionality to grab all the INSERTED Id… May 11, 2026 at 4:26 pm
  • Editorial Team
    Editorial Team added an answer Simply drag the class from the projects tree on to… May 11, 2026 at 4:26 pm
  • Editorial Team
    Editorial Team added an answer Architecture is one of those things that isn't simply a… May 11, 2026 at 4:26 pm

Related Questions

Greetings, I'm trying to find a way to 'unbind' a socket from a particular
Greetings. I'm looking for a way to parse a number of XML files in
Greetings! I'm working on wrapping my head around LINQ. If I had some XML
Greetings, I'm trying to find either a free .NET library or a command-line executable
Greetings, I need a way (either via C# or in a .bat file) to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.