Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
public bool ThemSP(Product p)
       {
           return productDAL.ThemSP(p);
       }
       private bool KiemTraSP(int maSP)
       {
           return productDAL.KiemTraSP(maSP);
       }
       public bool SuaSP(Product p)
       {
           if (KiemTraSP(p.ProductID))
               return productDAL.SuaSP(p);
           else
               return false;
       }


the error is " 'productDAL.ThemSP(p)' is unaccessible due to its protection level. i have typed this like my teacher did, don't know what i'm missing. Please help.

What I have tried:

i dont know what to try yet....................................
Posted
Updated 12-Nov-22 8:07am

1 solution

Check the definition of ThemSP within the class that productDAL is defined to be to find out what access modifier is assigned: public, private, protected, internal, or protected internal.

If the class is in a different file, assembly, or namespace then it my well be accessible to other code, not not to yours. The only way to "fix" that is to change the access modifier or stop trying to call it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900