Error connecting to a remote SQL server database Visual Studio 2017

This could be due to MSSQL data source type. Switching to OLE DB data source type worked for me . I was using:-

Microsoft SQL Server 2016 (SP2-CU2) (KB4340355) - 13.0.5153.0 (X64) Jun 28 2018 17:24:28 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2016 Datacenter Evaluation 10.0 (Build 14393: ) (Hypervisor)

The solution link. https://stackoverflow.com/a/20077395/8917467


For those who did code first migrations and have this issue, just right click on the connection name in server explorer and select 'Modify this connection...' then click on the save password tick box. Click OK and hey presto it all works again.


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