Solved

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

Posted on 2010-08-19
7
195 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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