-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?

1

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

From the description of the problem in the question, this is almost certainly the answer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.