【问题标题】:Error 1 Inconsistent accessibility: parameter type错误 1 ​​可访问性不一致:参数类型
【发布时间】:2017-11-24 09:08:49
【问题描述】:

我不断得到:-

错误 1 ​​可访问性不一致:参数类型“System.Collections.Generic.List”的可访问性不如方法

不知道怎么回事,请帮忙

List<receipt> _list;
        string _total, _cash, _change, _date;

        public Form8(List<receipt> datasource, string total, string cash, string change, string date)
        {
            InitializeComponent();
            _list = datasource;
            _total = total;
            _cash = cash;
            _change = change;
            _date = date;
        }



   class receipt
    {
        public int id { get; set; }
        public string productname { get; set; }
        public string type { get; set; }
        public int quantity { get; set; }
        public double price { get; set; }
        public string Total {  get { return string.Format("{0}kz", price * quantity); } }



    }

【问题讨论】:

  • 我猜class Form8Form8() 是公开的,收据没有修饰符或者是internal
  • 可以出示收据吗?请发布课程。
  • @john 是的 class form8 是公开的
  • @Marcio 跟duplicate 一样。

标签: c# reportviewer


【解决方案1】:

只需公开收据即可。如果调用者甚至无法访问收据,则您无法在 form8 构造函数中请求这些列表。

【讨论】:

    猜你喜欢
    • 2015-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-12
    相关资源
    最近更新 更多