Hello friends I am working on 3 layers with WebForms and I am already in the presentation layer, I try to run the layer in some browser and I get this error:
CS0246: Can not find the type or space name of 'Business' names (missing a using directive or a reference from assembled?)
Line 6: using System.Web.UI;
Line 7: using System.Web.UI.WebControls;
Line 8: using Business;
Line 9:
Line 10: public partial class _Default: System.Web.UI.Page
This is the code of my presentation layer
using System; using System.Data; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Business;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
gvMostrar(sender, e);
}
protected void Agregar(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
AccesoLogica negocio = new AccesoLogica();
string nombre = txtNombre.Text;
string apellido = txtApellido.Text;
int edad = Int32.Parse(txtEdad.Text);
int resultado = negocio.Insert(nombre, apellido, edad);
if (resultado > 0)
lblMensaje.Text = "Nuevo Registro Agregado Satisfactoriamente.";
else
lblMensaje.Text = "Nombre: [" + txtNombre.Text + "] ya existe, agrege otro";
negocio = null;
}
protected void gvMostrar(object sender, EventArgs e)
{
GridView.DataSource = AccesoLogica.ObtenerEmpleados();
GridView.DataBind();
txtEdad.Text = txtNombre.Text = txtApellido.Text = "";
}
}
This is the code of my library Business, in which I am using the class ACCESS DATA WHERE I BRING THE METHODS THAT I BELIEVE.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data; using TresCapas;
namespace Business { public class AccesoLogica { public static DataTable Get Employees () { return Data.ObtainEmployees (); }
public int Insert(string Nombre, string Apellido, int Edad)
{
AccesoDatos acceso = new AccesoDatos();
return acceso.Insert(Nombre, Apellido, Edad);
}
}
}