Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference)

Name project MvcApplication1) on ASP.Net Visual Studio 2012
Could anyone help me ? Thank's in advance ...

Here is the coding on TestController.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Dynamic;

namespace MvcApplication1.Controllers
{
public class TestController : Controller
{
public string MyFirstMethod()
{
return "Welcome ToString Queenspoted" ;
}

public ActionResult MyFirstViewMethod()
{
CustomerBAL b = new CustomerBAL();
Customer c = b.GetCustomer();

ViewBag.CustomerData = c;
return View("MyFirstView");
}
}
}

What I have tried:

I had changed targed framework from .Net Framework 4.5 to .Net Framework 4.0.But it does not work...
Posted
Updated 13-Dec-17 21:58pm
Comments
Richard Deeming 14-Dec-17 6:44am    

1 solution

Where is CustomerBAL defined?
If it has a different namespace you need to specify it with new <namespace>.CustomerBAL() or by using the namespace at the top of the file.
If it's an a different assembly, you need to reference that assembly, then do the above.
 
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