带有错误报告的错误代码 [英] error code with crystall report

查看:85
本文介绍了带有错误报告的错误代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码

i have this code

try
            {
                cls_Koneksi_DB.objConn.Open();
                F_Laporan_Pembelian_Barang lapBeli = new F_Laporan_Pembelian_Barang();
                CR_Pembelian_Barang laporan = new CR_Pembelian_Barang();
                if (this.radioButton1.Checked == true)
                {
                    laporan.RecordSelectionFormula = "";
                }               
                if (this.radioButton2.Checked == true)
                {
                    laporan.RecordSelectionFormula = "{t_Data_Barang.Tanggal}>='" + dateTimePicker1.Text + "'AND{t_Data_Barang.Tanggal}<='" + dateTimePicker2.Text + "'";

                }
               
                lapBeli.CR_Beli.DisplayGroupTree = true;// on this row  "Error    1    'SID_TBJATIMULYA.F_Laporan_Pembelian_Barang.CR_Beli' is inaccessible due to its protection level"

                lapBeli.CR_Beli.ReportSource = laporan;
                lapBeli.CR_Beli.Refresh();
                lapBeli.Show();
            }
            catch (SqlException en)
            {
                MessageBox.Show("adfasd," + en.ToString() + "");
            }
            finally
            {
                cls_Koneksi_DB.objConn.Close();
            }


可以给我寻求解决方案?


can give me for solution??

推荐答案

如果成员位于不同的classes/structs中并被标记为private.,则需要使用默认级别的内部如果classes/structs在同一程序集中.
如果它们在不同程序集中中,则需要将成员标记为 public 以便访问.

在您的代码中,只需检查您要访问的方法DisplayGroupTree非私有即可.

另请注意,您可以使用 partial 关键字将单个class/struct跨多个源文件.

请看以下具有更多信息的链接:
http://msdn.microsoft.com/en-us/library/ms173121(VS .80).aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/wa80x488(VS .80).aspx [ ^ ]
If the members are in different classes/structs and are marked as private. You will need to use the default level of internal if the classes/structs are within the same assembly.
If they are in different assemblies, then the members will need to be marked as public to be accessible.

In your code, just check the method DisplayGroupTree which you''re trying to access is not private.

Please also note that you can span a single class/struct across multiple source files using the partial keyword.

Look at following links with more information:
http://msdn.microsoft.com/en-us/library/ms173121(VS.80).aspx[^]
http://msdn.microsoft.com/en-us/library/wa80x488(VS.80).aspx[^]


这篇关于带有错误报告的错误代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆