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.
Open your own vs2012, select "View" in the menu inside, and select "Server Management Resources" under "View", as shown in the figure:
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:
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:
In the "Connect to Database" column, we select the database name we just wanted to choose, "laboratory", as shown in the figure ~
After the selection is completed, we click on the "laboratory" just now, right-click on the properties, as shown in the figure:
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:
In the "webconfig" configuration interface, we can replace the "value" value in the "key" string with the code we just copied:
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:
The above is the operation method of connecting VS2012 to SQL database brought by the editor. Friends in need should not miss it.