Solved

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

Posted on 2010-08-19
7
201 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

624 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