How to connect sql database in VS2012-How to connect sql database in VS2012

Time: 2021-01-13Source: Huajun Software TutorialAuthor: Xiaoxin

Don’t you still know how S2012 connects to the SQL database? Then for those who don’t know, hurry up and learn the operation method of VS2012 connecting to the SQL database brought by the editor. I hope it can help everyone.

First, open your own database, "SQLServer 2008R2" is used here. After opening your own database, find the name of your own database, as shown in the figure. If you want to connect to the database named "laboratory", use this database as an example.

How to connect to SQLServer database in vs2012 website backend c#

Open your own vs2012, select "View" in the menu inside, and select "Server Management Resources" under "View", as shown in the figure:

How to connect to SQLServer database in vs2012 website backend c#

In the interface that appears, we select "Data Link", right-click on the "Data Link" option, and we select "Add Link", as shown in the figure:

How to connect to SQLServer database in vs2012 website backend c#

This panel appears after selecting "Add Link". We select "(local)" for the server and write it directly. For "Log in to the server" select "Log in using SQL Server", as shown in the figure:

How to connect to SQLServer database in vs2012 website backend c#

In the "Connect to Database" column, we select the database name we just wanted to choose, "laboratory", as shown in the figure ~

How to connect to SQLServer database in vs2012 website backend c#

After the selection is completed, we click on the "laboratory" just now, right-click on the properties, as shown in the figure:

How to connect to SQLServer database in vs2012 website backend c#

After right-clicking "Properties", this interface appears on the right side of the software vs2012. We directly select "Connection String" and copy a large string of codes behind it, as shown in the figure:

How to connect to SQLServer database in vs2012 website backend c#

In the "webconfig" configuration interface, we can replace the "value" value in the "key" string with the code we just copied:

How to connect to SQLServer database in vs2012 website backend c#

After replacing the string, we need to change the "Password" just now to our own database password, and the user name to our own user name, as shown in the figure:

How to connect to SQLServer database in vs2012 website backend c#

The above is the operation method of connecting VS2012 to SQL database brought by the editor. Friends in need should not miss it.

Related articles更多>>

Popular recommendations