Connect to SQL Server in Visual Studio Using Add Adapter Service Reference Plug-in
Article
To connect to SQL Server using the SQL adapter in a .NET programming solution, you must use the Add Adapter Service Reference Visual Studio Plug-in. This topic provides instructions on how to use the Add Adapter Service Reference Plug-in.
Connecting to SQL Server Using Add Adapter Service Reference Plug-in
Perform the following steps to connect to SQL Server using the Add Adapter Service Reference Plug-in.
To connect to SQL Server
To connect using the Add Adapter Service Reference Plug-in in a programming solution:
Create a project in Visual Studio.
Right-click the project in Solution Explorer, and then click Add Adapter Service Reference. The Add Adapter Service Reference Plug-in opens.
From the Select a binding drop-down list, select sqlBinding, and then click Configure.
In the Configure Adapter dialog box, click the Security tab, and from the Client credential type drop-down list, do one of the following:
Connect to SQL Server by using Windows authentication.
Windows
Connect to SQL Server by using Windows authentication.
Username
Specify the user name and password to connect to SQL Server by specifying credentials for a user defined in SQL Server database. Note that the user name and password are case-sensitive. Note: If you leave the User name and Password fields as blank, the adapter connects to SQL Server using Windows authentication.
Click the URI Properties tab, and then specify values for the connection parameters. For more information about the connection URI for the SQL adapter, see Create the SQL Server connection URI.
Note
If the connection parameters contain any reserved characters, you must specify them as-is in the URI Properties tab, that is, without using any escape characters. However, if you specify the URI directly in the Configure a URI field and the connection parameters contain reserved characters, you must specify the connection parameters using proper escape characters.
Note
If you do not specify any values in the URI property tab, the Consume Adapter Service Add-in puts the URI as mssql://.//. In such a case, the adapter connects to the default database and the default database instance on the local computer.
Click the Binding Properties tab, and then specify values for the binding properties, if any, required by the operations you want to target.
Click OK.
Click Connect. After the connection is established, the connection status is shown as Connected.
The following figure shows the Consume Adapter Service Add-in immediately after the connection is established. The graphical user interface is same for the Add Adapter Service Reference Plug-in.
The Add Adapter Service Reference Plug-in displays different nodes containing various operations that can be performed on SQL Server. For example, the Procedures node contains all the procedures available for the database you connected to. Similarly, the Tables node contains all the tables in the database you connected to, and the operations that can be performed on a table. For more information about these nodes, see Metadata Node IDs.
Learn how to securely connect an Azure SQL server using an Azure Private Endpoint via the Azure portal, ensuring private and safe communication with your SQL server.