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 8722295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:22:49+00:00 2026-06-13T07:22:49+00:00

objectdatasource is not referencing the correct constructor depending on the parameters I have(scaled down

  • 0

objectdatasource is not referencing the correct constructor depending on the parameters

I have(scaled down version)

    private int m_Code;
    private string m_FamCode;
    private string m_LastName;
    private string m_FirstName;
    private string m_Init;
    private DateTime chargeDate;
    private string tranCode;
    private decimal paidAmt;
    private string description;

Then I have the get\set for each

public int M_Code
        {
            get { return m_Code; }
            set { m_Code = value; }
        }

Then I have 3 different constructors that look like the following but pass different amount of properties to each one.

public BBNMemberDetails(DateTime cDate, string tCode, decimal pAmt, string desc)
        {
            this.chargeDate = cDate;
            this.tranCode = tCode;
            this.paidAmt = pAmt;
            this.description = desc;
        }


 public BBNMemberDetails(int m_Code, string m_FamCode, string m_LastName, string m_FirstName, string m_Init)
    {
        this.m_Code = m_Code;
        this.m_FamCode = m_FamCode;
        this.m_LastName = m_LastName;
        this.m_FirstName = m_FirstName;
        this.m_Init = m_Init;
        this.m_Title = m_Title;

}

default constructor

  public BBNMemberDetails() { }

For some reason the only constructor that is being referenced is the one with all my properties. The constructor where I would like to just grab the transaction information is not being referenced. I am using a List in combination of a sqldatareader that references a storedprocedure to grab the values also then just an objectdatasource on the front end to attach it to the gridview. But my gridview shows all the properties instead of just the few I want it to show in the constructor.

  • 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. Editorial Team
    Editorial Team
    2026-06-13T07:22:51+00:00Added an answer on June 13, 2026 at 7:22 am

    When you call a constructor, you get a complete object.

    The object isn’t pared down because you call a constructor that initializes fewer members.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using subsonic and a gridview with objectdatasource (I have not used an
I have an ObjectDataSource (but perhaps this question is the same for all kinds
I have trouble getting a custom ObjectDataSource for an asp:ListView control to work. I
Can someone explain exactly how/when an ObjectDataSource fires? I have an ASP.NET page, with
I have a dropdownlist connected to a objectdatasource. How can I get the DataValueField=TypeId
I have an objectdatasource that will return a potentially large collection (up to 200,000
I have objectdatasource and I am trying to find a way to capture the
In my paginated GridView (contained in an UpdatePanel) bound to ObjectDataSource, I have an
I have GridView and this grid has setup paging, but this paging not show
I have an ObjectDataSource on an ASP.NET WebForms page, that also has a data-bound

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.