?
Solved

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

Posted on 2010-08-19
7
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

718 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