Click here to Skip to main content
16,018,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have this code

C#
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??
Posted
Updated 4-Jul-12 23:42pm
v2

1 solution

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[^]
 
Share this answer
 

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