Results 1 to 2 of 2

Thread: The Type or Namespace name WBEntities could not be found.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    The Type or Namespace name WBEntities could not be found.

    Hi

    public ActionResult Details()
    {
    WbEntities WB = new WbEntities();

    var SchemeList = (from scheme in WB.Customer
    select scheme).ToList();


    return View(SchemeList);
    }

    <connectionStrings>
    <add name="WBEntities" connectionString="metadata=res://*/Models.MyTestDB.csdl|res://*/Models.MyTestDB.ssdl|res://*/Models.MyTestDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=JAGJIT-PC;initial catalog=WB;user id=sa;password=pwd;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>

    Thanks

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: The Type or Namespace name WBEntities could not be found.

    It could be that the WBEntities is created inside the Models folder or somewhere else. In your controller, add reference to that entity such as sample code below. Given that the WBEntities.edmx is created inside the Models folder.

    C# Code:
    1. using YourNamespace.Models;
    Last edited by KGComputers; May 2nd, 2016 at 11:55 AM.
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width