Reputation: 1415
I'm just publishing my website to my domain name and when I try to access it in my browser I get the Following error:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I think the problem is into my connection String ==>
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
<add name="TennisOnlineContext" connectionString="Data Source=|DataDirectory|Tennis.sdf" providerName="System.Data.SqlServerCe.4.0 " />
</connectionStrings>
...
</configuration>
Sorry but it's my first web site where I try to publish... So, please what I'm doing wrong ? Thanks in advance...
Upvotes: 1
Views: 12227
Reputation: 18980
If you are connecting from Windows machine A to Windows machine B (server with SQL Server installed), and are getting this error, you need to do the following:
On machine B:
1.) turn on the Windows service called "SQL Server Browser" and start the service
2.) in the Windows firewall, enable incoming port UDP 1434 (in case SQL Server Management Studio on machine A is connecting or a program on machine A is connecting)
3.) in the Windows firewall, enable incoming port TCP 1433 (in case there is a telnet connection)
4.) in SQL Server Configuration Manager, enable TCP/IP protocol for port 1433
Upvotes: 4
Reputation: 1210
Enable TCP/IP and Named Pipes in SQL Server Configuration Manager.
From SQL Server Configuration Manager, select SQL Server Network Configuration, then select the appropriate instance (if you have multiple). Right click and select enable for Named Pipes and TCP/IP.
Upvotes: 0
Reputation: 23833
Have you tried localhost\SQLEXPRESS
? Ensure all of your connection keywords abide by those outlined by Microsoft here.
You can check if a connection string is valid, or indeed build a valid connection string that you can copy, by using the SQL/Database Connection utility that ships with VS2010. In VS2010 goto Tools, Connect to database. This will launch the connection dialog; here you can build and test connection strings. For advance connection features, once in the dialog click Advanced. From the advance dialog you can copy and paste connection strings.
Microsoft have also released this dialog to be freely used and distributed in .NET applications. If you interested in this it can be found here.
I hope this helps.
Upvotes: 4
Reputation: 81
please check once TCP/IP properties in SQL server configuration manager
for more details here
Upvotes: 0
Reputation: 665
If you look into your release version of web.config you will find <roleManager enabled="false"
Change this configuration setting to True
You can find details here at this link below
http://dotnet1blogger.blogspot.com/2012/04/network-related-or-instance-specific.html
Upvotes: 0