Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 14, 2010 07:54 AM by Harshit_Pandey
Oct 16, 2008 04:04 AM|LINK
I am completely stumped.
I can connect from Management Studio using my domain credentials.
From within the VS IDE I can connect to the database ok however when I try debugging my WebApp it comes up with
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)
The connection string from the web.config is
Things I have tried.
So I have absolutely no idea what to do anymore.
Can anyone give me suggestions on what to try?
Oct 16, 2008 07:09 AM|LINK
Well it turns out that I have extended the membership provider but forgot to extend the role provider. So even though the membership provider was quite happy looking at my connectionstring the default Role Provider was searching for an SQLExpress install.
Oh well hope someone learns from my mistakes :)
Oct 16, 2008 06:35 PM|LINK
Thank you for your post...you saved me lots of time...
I had similar problem but when trying to connect with Management Studio got the same error. The issue is that I had this working just a few days (weeks?) ago, so something (a patch, configuration, etc) changed.
Anyway, before I would try to connect with "machineName\InstanceName" (KC118052\SQLDEV)...after reading your post and having done the rechecking from
http://www.mydigitallife.info/2007/10/31/error-has-occurred-while-establishing-a-connection-to-sql-server-2005-which-does-not-allow-local-and-remote-connections/ I remembered some issues I was having with IIS 7.0 and changes I made. I tried then connecting
with ".\InstanceName" (.\SQLDEV) and it worked!
So the problem arose from somehow not recognizing that KC118052 was the localmachine...weird...I think I'm heading towards having to rebuild the entire machine...argh!
Thank you again.
Update: Found the reason(?) for the issue: the hosts file had the wrong public IP for my machine's name. Once corrected the issue went away. I can now connect both to .\sqldev and kc118052\sqldev
Oct 29, 2008 03:25 AM|LINK
I'm getting this same error and it's driving me nuts. In my project, initially I was using SQLExpress, but later changed to using an MS-Access database for simplicity's sake. It works just perfectly on my development machine. However, after uploading
the files to the web server, it still seems to think I want to connect to a SQL Server database for some unknown reason. I've copied and recopied all of the required files to the web server, but no luck. What on Earth could I be missing?
- Robert -
Oct 29, 2008 12:59 PM|LINK
Are you by any chance using linq in your solution?
Is your access database installed remotely from the web server?
Oct 30, 2008 03:06 AM|LINK
No, I'm not using Linq. But, I'm not sure what you mean when you ask about the Access database being installed remotely from the web server. I simply dropped the MDB file in the App_Data folder directly under the website's root folder just like it is
in my project locally. I'm using the AccessDataSource control manage the data connection.
Oct 30, 2008 04:56 AM|LINK
Well, I sucked it up and just completely rebuilt my solution from scratch and then replaced the web forms and code files from what I had already developed and now it finally works on the server. Obviously there was some leftover crap somewhere (in the web.config
probably) that was somehow referencing the SQLExpress database I started with.
I'm going to try and compare the old web.config with the new, but I have a feeling this is going to remain an unexplained mystery.
Feb 13, 2009 10:03 AM|LINK
I had similar issue, when I unistalled the SQL which had a Named Instance and Installed SQL with Default Instance.
The Error I got 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)
To resolve the issue - I had to change the VSTS Options; From Tools -> Options -> Data base Tools -> Design Time - Validation Data base -> Connection Options -> SQL Serevr Instance Name = Blank.
Hope this info will be helpful for some people.
Data base Projects
Mar 14, 2009 10:36 AM|LINK
I have a similar error, however, can you specify how you went about solving this issue when it occurred?
Mar 25, 2009 04:42 AM|LINK