Reputation:
I created an SQL Alias:
Name: CIHDB
Server: SQLSRV
Protocol: tcp
Port no: (empty)
My connection string within Visual Studio says:
Data Source=CIHDB;Initial Catalog=CIH;Integrated Security=SSPI;MultipleActiveResultSets=True;Application Name=EntityFramework
But that fails with the error: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.
When I change the "Data Source" in the connection string to "localhost," I connect with no problem.
I am thinking that I am using the wrong protocol in the Alias.
Can anybody shed some light on this?
Thanks Eric
Upvotes: 1
Views: 2929
Reputation:
When I used both
cliconfg.exe
and
c:\windows\syswow64\cliconfg.exe
(64 and 32 bit versions of cliconfg.exe)
I saw that tcp/ip was not enabled and so once I fixed that, all fell into place.
Upvotes: 3