I'm getting the below error while trying to connect and get the data to Visual webpart (VS 2013) from SQL Server 2016:
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Approaches that I tried :
I'm able to add connection successfully in server explorer (VS2013).
Tried binding the grid view with the SQL data getting this error:
I'm able connect to the SQL Server 2016 with Management Studio 2012 with same account
I tried by restarting services and enabling
TCP/IP
stopping the firewall in SQL Server nothing fixed, checked SQL connection properties in Management Studio allow remote connections option is also checked