Solved

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

Posted on 2010-08-19
7
200 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Read top line from CSV file 14 59
Error in Visual Project 10 49
Make borderless form movable by user 2 27
VS C# Creating a library of functions 3 28
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

751 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