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

  • SEARCH
  • Home
  • 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 249107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:23:57+00:00 2026-05-11T21:23:57+00:00

I am having trouble with, as I said, setting a property’s property. Let’s say

  • 0

I am having trouble with, as I said, setting a property’s property. Let’s say I have a class that represents a transaction. In my class I have a property that represents another class, such as this:

Public Class PersonRecord

    _myPerson = new Person()

    Public Property MyPerson as Person
    Get
        _myPerson = Person.GetAppropriatePerson(Me.PersonID)

        return _myPerson
    End Get

    Set
        _myPerson = value
    End Set
    End Property

So I essentially have a property that has a get filter that gets the appropriate person. The problem is that when I want to set the Person’s info through the property, VB seems to ignore that I even did it, such as this:

Me.myPersonRecord.Person.Name = "Some Name"

But when I put a watch on this, after setting the property, my value does not change. I am puzzled by this behavior. Is there something I’m doing wrong? 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. Editorial Team
    Editorial Team
    2026-05-11T21:23:57+00:00Added an answer on May 11, 2026 at 9:23 pm

    Every time you do a get .MyPerson, the function Person.GetAppropriatePerson gets called.

    I do not know the implementation of that function, but I would guess that it returns a new Person object every time that it is called.

    You change the Name of one Person instance. The next time you call .MyPerson, another Person instance gets returned.

    Depending on how this is supposed to work, you could do a few things, for instance:

    • Call GetAppropriatePerson in the constructor (if personid is known at that time). Assign the return value to _myPerson, and make the MyPerson property read-only.
    • Or initialize _myPerson to null, then in the MyPerson getter have a if _myPerson == null Then _myPerson = GetAppropriatePerson etc.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that is like an IPOD playlist . Im having trouble
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that
Having Trouble with Entity Framework. I have been populating EntityReferences with an EntityKey inorder
I'm having some trouble using sessions with php.. I think I have figured out
I am having trouble doing what the title said. My goal is to be
I am having trouble with layout, I know I am close. /// I have
I'm having trouble using python function decorators in Google's AppEngine. I'm not that familiar
I am having trouble with a stored procedure that is pulling information from the
I am having real trouble installing SUDS in python 2.6.4. I have tried to
I am having trouble figuring out mem_fun_ref . I have to admit, I usually

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.