-2

I have a two project, one asp.net MVC project and second .net library project with entity framework 6.0 I just added reference of last project to the main MVC project and trying to use class OnlineShopEntities extended DBContext

OnlineShopEntities db = new OnlineShopEntities();
bool exists = db.User.Any(i => i.Username == username);

I have a error when using

No connection string named 'OnlineShopEntities' could be found in the application config file.

How can I add manually connection string in web.config file and how can I write it correctly?

needermen
  • 43
  • 1
  • 8
  • possible duplicate of [Setting up connection string in ASP.NET to SQL SERVER](http://stackoverflow.com/questions/5642474/setting-up-connection-string-in-asp-net-to-sql-server) – jmoerdyk Dec 10 '14 at 20:06

1 Answers1

1

Look in the app.config file for the project that contains your Entity Framework code. It likely contains the connection string you need to place in your MVC project's web.config.

Eric King
  • 11,594
  • 5
  • 43
  • 53