Solved

I get a SQL Connection error even if I'm not connecting to it

Posted on 2010-08-19
7
197 Views
Last Modified: 2012-05-10
I have this old asp.net application that I've been using for years, for some reason after I press the login button I get this 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)

The funny thing is that the login routing ends well but this errors keeps appearing, so I made a new clean web project (vs 2010), get into the login screen, enter a fake user name and password, press login and it keeps loading for a minute apparently looking for some server, and after that I get the error.

If I look for the specific error in Google I get lots of forums on it, but they are for the real symptom when you're actually trying to connect somewhere, since I'm not doing and connection its really hard to find a solution
0
Comment
Question by:yuval08
7 Comments
 
LVL 10

Expert Comment

by:Jini Jose
ID: 33476416
i think you have uploaded the same web.config as in your local computer. just write the connection string in top of the page. then check
0
 
LVL 5

Expert Comment

by:JayFromPep
ID: 33476417
is the sql server available?  even if you are running it on your machine, the application has to know where to go to do the validation.

The membership provider could be jacked up.

Those are a couple of things that come to mind quickly.
0
 
LVL 10

Expert Comment

by:Jini Jose
ID: 33476441
do one thing, just create a new page, and onload, write the connection string in the response. then on a butotn click event open the connection.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:yuval08
ID: 33477206
this is my web.config file, in the login method I create a regular SqlConnection object and run my routing, it works great, then I execute FormsAuthentication.RedirectFromLoginPage after the user validation and then that error appears and no where in my routing I'm trying to open another sql connection
<?xml version="1.0"?>
<configuration>
	<appSettings>
		<add key="sqlConnStr" value="Server=MyServer;Initial Catalog=MyDB;uid=MyUser;pwd=MyPassword;"/>
	</appSettings>
	<connectionStrings/>
	<system.web>
		<compilation debug="true" targetFramework="4.0">
		</compilation>
		<authentication mode="Forms">
			<forms loginUrl="login.aspx"/>
		</authentication>
		<authorization>
			<deny users="?"/>
		</authorization>
		<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
</configuration>

Open in new window

0
 
LVL 10

Expert Comment

by:Jini Jose
ID: 33477452
is your user validation or user login page contains any sqldatareader ?
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 33477655
Just trying to solve it either way. You said, " in the login method I create a regular SqlConnection object"

Is your connection object is closed or are you maintaining same connection object to be use later in your application.
0
 

Accepted Solution

by:
yuval08 earned 0 total points
ID: 33478668
It was just as I thought, it required SQL Express to be installed in order to run thanks guys anyway...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now