Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error connecting to a remote SQL server database Visual Studio 2017

I have an SQL server 2016 instance running on Windows server 2016, I'm trying to connect to the DB from a remote PC in Visual Studio 2017 Community using the Server Explorer. The connection is successful and I can see the Databases available on the server and login just fine but when I try to expand the tables folder I get this error:

Failed to retrieve data for this request
Failed to connect to server (local)
Login Failed for user 'xxxxx'

The thing is I can connect just fine the same way using Visual Studio 2015 Enterprise means I can see the tables and alter them.

I made sure that the user had all the permissions granted on the server, And to me it doesn't seem to be a permission issue since the connection work just fine in VS 2015.

like image 404
Fadi Banna Avatar asked Mar 28 '17 16:03

Fadi Banna


People also ask

How do I enable remote connections to SQL Server 2017?

Right-click on your server name and click 'Properties'. Go to the Security page for Server Authentication, and select 'SQL Server and Windows Authentication' mode. Then, go to the Connections page and ensure that "Allow remote connections to this server" is checked, and click OK.

How do I connect to a SQL Server database remotely from Visual Studio?

Right click on 'Data Connections' then click 'Add Connection'. On the next screen (Choose Data Source) change the data source ensure 'Microsoft SQL Server' is selected then click the 'Continue' button. In the 'Server name' field enter 'SQL-SERVER'. Change the 'Authentication' method to 'SQL Server Authentication'.

Can't connect to remote SQL Server?

Check to see if allow remote connections for this server is enabled. In SSMS, right click on the instance name and select Properties. Go to the Connections tab and make sure Allow remote connections to this server is checked. If you need to make a change, you must restart the SQL Server instance to apply the change.


1 Answers

This would help. Make sure you check the "Save my password" checkbox when you add new database connection.

Add Connection Dialog with Save my password checked

like image 116
Kiratijuta Avatar answered Nov 05 '22 07:11

Kiratijuta