Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi. error is " BLL.loginBLL inaccessible due to its protection level"

my code is :

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Services;
using BLL;

namespace reza3layer_3
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void login_button_Click(object sender, EventArgs e)
        {
            String xusername = userName_textbox.Text;

            String xpwd = password_textbox.Text;


            try
            {
                
                loginBLL oBLL = new loginBLL();
                bool match = oBLL.checking(xusername, xpwd);

               

                else
                {
                   
                }
            }
            catch (Exception ee)
            {
               

            }
            finally
            {
                

            }
        }
    }
}


withal had done add references(BLL,DAl) to project.

thanks in advance.
Posted
Comments
Maarten Kools 15-Jan-14 5:48am    
What is the loginBLL class? Is it something from a library, or something you've created yourself?

Either way, the loginBLL class is either internal or private in the assembly where it comes from, and hence you'll not be able to use it in a different assembly.
CPallini 15-Jan-14 5:51am    
Exactly, my (virtual) 5.
comptech1 15-Jan-14 6:01am    
loginBLL is create by myself . and it is not internal
Maarten Kools 15-Jan-14 6:02am    
You should post the code of that class then, use the "Improve question" to add this code.
comptech1 15-Jan-14 23:20pm    
thank you

I'm going to ask what might seem like a blindingly obvious question, but is your loginBLL class declared as public? In other words is it declared as
C#
public class loginBLL
{
}
If it is, does it have a public constructor, i.e.
C#
public loginBll() {}
If it has a default constructor that isn't public then you won't be able to instantiate it from outside the loginBLL class.
 
Share this answer
 
v2
Comments
comptech1 15-Jan-14 23:24pm    
thanks very much
Just a guess, but did you create loginBLL as a Singleton class? If so, then you need to look at how you get the instance.
The error message indicates that the loginBLL constructor is not publicly available, so either it's a Singleton, or you need to create an instance of a derived class in order to use it.
 
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