Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have just purchased one new hosting space.
when i try to connection to database at local host it's working properly.
but when i upload on server that time one error is occurred as i mention below.
and i upload my database is "aspnetdb.mdf" file in "App_code" Folder.

my configuration string is: "
<add name="conn" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>"

Error is: 

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)

Please help me how can i connection form to database.

Updated 2-Sep-12 5:17am

Error Locating Server/Instance Specified
Looks your connection string is incorrect or the server is not accessible.
First and foremost make sure that the SQL Server services are running. Other reasons could be, incorrect connection string or some Firewall blockage.

Here, have a look at this blog post to troubleshoot the issue : MSDN Blogs: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified[^]

If needed, look at these one:
Exception - error 26 - Error Locating Server Instance Specified[^]
provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance...[^]
"Specified SQL server not found" o..[^]
Share this answer
did u install Sql server Express Edition with SQLEXPRESS Instanace... and check Fire wall SQL SERVER PORT 1433 you must enable port in server side.
and check SQL SERVER Instance and service running or not.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900