0
votes

I am having a problem with an error...

Error 1 Inconsistent accessibility: parameter type 'HRDMSV1.User' is less accessible than method 'HRDMSV1.FrmAddDoc.FrmAddDoc(HRDMSV1.User)'
All help appreciated?

namespace HRDMSV1 { public partial class FrmAddDoc : Form { User _user; private ConnStr connStr = new ConnStr(); public FrmAddDoc(User user) /* error here */ { InitializeComponent(); _user = user; }

namespace HRDMSV1 { class User { private String _userName; private String _password; private bool _readOnly; private int _userID;

    public String userName { get { return _userName; } set { _userName = value; } }
    public String password { get { return _password; } set { _password = value; } }
    public bool readOnly { get { return _readOnly; } set { _readOnly = value; } }
    public int userID { get { return _userID; } set { _userID = value; } }
} }
1
Could you show us your User class code? - D-Shih
You cannot use a class which is not public as a public method parameter, field or property. - Federico Dipuma
I have added User class - Gerry Mac

1 Answers

0
votes

Your User class is less accesable than the public constructor FrmAddDoc which is not allowed. For more reference see CS0051