8/23/2018

How to create connection string in ASP.NET MVC application?

When we need to connect to the existing database, we need to edit the file Web.config and add the section <connectionStrings>.

To bind the Data context and Database, we use the <connectionString> section.
Inside this section, we write the connectionString attribute.
The value of this attribute can be taken by copying from the Data connection properties.

Go step by step:
Server Explorer > Data connection > BookContext > Properties > Connection String.

No comments:

Post a Comment