Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Property access

Posted on 2004-11-30
10
Medium Priority
?
221 Views
Last Modified: 2010-04-15
Here's my setup.

public abstract class RateLabelBase

protected int mRateId = 0;

            public int rateId {
                  get { return mRateId; }
                  set {
                        if(value != mRateId) {
                              mRateId = value;
                        }
                  }
            }

*********************

public class RateLabel : RateLabelBase{ .... }

*********************

      [TestFixture]
      public class RateLabelUnitTest
      {
            [Test]
            public void testRate(){
                  RateLabel rl = new RateLabel();
                  
                  rl.rateId = 4;
                              }
                }

********************

it's saying that rl.rateId is not a member. What's up with this?

the ******** mean file delimitations
0
Comment
Question by:jayrod
  • 5
  • 2
  • 2
9 Comments
 
LVL 16

Accepted Solution

by:
muzzy2003 earned 750 total points
ID: 12708537
What's in RateLabel? Can you post this, and also the actual code for RateLabelBase not the version you've given?
0
 
LVL 8

Assisted Solution

by:gelbert
gelbert earned 750 total points
ID: 12708755
mRateId is declared as PROTECTED ( it could be only used inside derived class), Change declaration to PUBLIC to be able to access it outside class code
0
 
LVL 8

Expert Comment

by:gelbert
ID: 12708772
Opps, sorry please disregard post above. I have looked at wrong line....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:muzzy2003
ID: 12708777
He's not trying to access mRateId directly, he's using a property accessor which is public.
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 12708781
Sorry, crossed with your last post. :)
0
 
LVL 3

Author Comment

by:jayrod
ID: 12711253
I forgot to add a fricken referrence to the new dll.. gawd
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 12711288
Can you remove the accepted answer please? You've solved the problem yourself, and should open the question and just get the points refunded. Check here for details:

http://www.experts-exchange.com/help.jsp#hi17

I certainly don't want a C grade down on the record.
0
 
LVL 3

Author Comment

by:jayrod
ID: 12711503
doh.. how do I undo it?
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 12711532
Go to the link I posted, it'll tell you. You need to make a post in Community Support.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question