4
I am getting some errors when trying to perform a query in SQL Server from a Webservice hosted on an IIS 7.5 server.
My connectionString on the web.config:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="TESTEPENDENCIA" providerName="System.Data.SqlClient" connectionString="Data Source=tcp:179.191.87.22; User ID=SISTEMA; Password=SYSUSER;Initial Catalog=TESTEPENDENCIA; timeout=100" />
</connectionStrings>
<dataConfiguration defaultDatabase="TESTEPENDENCIA" />
Error returned by browser:
"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. (Ovider: TCP Provider, error: 0 - A Connection Attempt failed because the Connected party Did not properly Respond after a period of time, or established Connection failed because Connected host has failed to Respond.)"
If you remove the "tcp" protocol from the Data Source, the following error is returned:
"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. (Preview: Named Pipes Provider, error: 40 - Could not open a Connection to SQL Server)"
The two errors occur when trying to access databases on different servers.
The interesting thing is that on another IIS server (which unfortunately I can’t see the version, but which runs on a Windows Server 2003), access to the database normally occurs.
I took a look at the easiest settings of the IIS server, but I don’t have much knowledge to infer any configuration just from that. My initial idea was that maybe the application was looking for some inherited connectionString, but that doesn’t seem to be the case, since removing the tag from the web.config
local the same claims the lack of it.
Using the
IIS Express
(development environment) works in a good?– Jéf Bueno
I’m sorry, I didn’t quite understand your question (as I said, I’m practically a full layman at ISS). Isn’t ISS Express a lighter, more limited version of ISS? Or is there another way I can test my application on the server other than the default?
– Matheus Oliveira
In the machine in which you developed the
webservice
works normal? TheISS Express
is the tool used to test web applications under development (usually visual studio starts it by itself)– Jéf Bueno
Oh yes, sorry. Yes, on the machine the webservice works normally.
– Matheus Oliveira
Behold this link
– Jéf Bueno