Alan Silver
2006-03-01 18:45:44 UTC
Hello,
I have SQL Server 2005 standard edition installed on my local machine,
along with IIS6 and .NET 2.0.
I downloaded the ASP.NET design templates from MS (see below for URL),
and one of them uses a database. This one gives me the following error
when it tries to access the database...
"An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)"
Now, I have done some searching on this error, and it generally seems to
arise when you are trying to connect to SQL Server from another (ie
remote) machine. I'm not, I have SQL Server and IIS on the same machine.
I have followed all the advice mentioned on
http://www.datamasker.com/SSE2005_NetworkCfg.htm (even though that's for
remote access and this is local), and have rebooted the machine. None of
this helped.
The connection string in the web.config file looks like this...
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\pubs.mdf;
Integrated Security=True;User Instance=True
I strongly suspect that the problem could be the SQLEXPRESS data source
there, but I have tried changing that to MSSQLSERVER, 127.0.0.1, (local)
and various other things without success. I tried changing the "Data
Source" to "Server" and using the same names, but that also failed.
Looking in the Server Management Studio, I right-clicked the server and
chose properties, then clicked the link "view connection properties"
which showed an empty instance name. I don't know if this is the
problem. As far as I know, there's only the one instance installed.
Any ideas how to sort this? TIA
I have SQL Server 2005 standard edition installed on my local machine,
along with IIS6 and .NET 2.0.
I downloaded the ASP.NET design templates from MS (see below for URL),
and one of them uses a database. This one gives me the following error
when it tries to access the database...
"An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)"
Now, I have done some searching on this error, and it generally seems to
arise when you are trying to connect to SQL Server from another (ie
remote) machine. I'm not, I have SQL Server and IIS on the same machine.
I have followed all the advice mentioned on
http://www.datamasker.com/SSE2005_NetworkCfg.htm (even though that's for
remote access and this is local), and have rebooted the machine. None of
this helped.
The connection string in the web.config file looks like this...
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\pubs.mdf;
Integrated Security=True;User Instance=True
I strongly suspect that the problem could be the SQLEXPRESS data source
there, but I have tried changing that to MSSQLSERVER, 127.0.0.1, (local)
and various other things without success. I tried changing the "Data
Source" to "Server" and using the same names, but that also failed.
Looking in the Server Management Studio, I right-clicked the server and
chose properties, then clicked the link "view connection properties"
which showed an empty instance name. I don't know if this is the
problem. As far as I know, there's only the one instance installed.
Any ideas how to sort this? TIA
--
Alan Silver
(anything added below this line is nothing to do with me)
Alan Silver
(anything added below this line is nothing to do with me)