when i log in, i get the "An error has occurred while establishing a connection to the server" error.


My website online but when i enter log in details I get the following page.   

Server Error in '/' Application.

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
   System.Web.UI.WebControls.Login.AttemptLogin() +105
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

 

 How can I resolve this issue?


____________________________________
u dont luv me the way that I luv u !!
0
ujjawal
6/5/2008 9:36:55 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

3 Replies
952 Views

Similar Articles

[PageSpeed] 0

The most likely cause of this is that your application cannot connect to the database required for the login authentication. You need to check the connection credentials, probably in the config file. This error can sometimes be a red herring so it might be an idea some post some of your code. 

0
markarmitage
6/5/2008 9:54:09 PM

This is my web.config file. Is there anything I need to add to make my log in system work. And that not get the  ""An error has occurred while establishing a connection to the server" error.

The database is already at the hosting server.

 

 

<?
xml version="1.0"?><!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration>

<appSettings/>

<connectionStrings>

<add name="kcolDatabaseConnectionString" connectionString="Server=mssql.namesco.net;Database=kcoldatabase;uid=kcol2;pwd=******;" providerName="System.Data.SqlClient"/>

<add name="ASPNETDBConnectionString" connectionString="Server=mssql.namesco.net;Database=kcolroles;uid=roles;pwd=******;" providerName="System.Data.SqlClient"/>

</connectionStrings>

<system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

Visual Basic options:

Set strict="true" to disallow all data type conversions

where data loss can occur.

Set explicit="true" to force declaration of all variables.

<customErrors defaultRedirect="~/redirect.aspx" />

-->

 

 

 

<
compilation debug="true" strict="false" explicit="true">

<assemblies>

<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

<pages>

<namespaces>

<clear/>

<add namespace="System"/>

<add namespace="System.Collections"/>

<add namespace="System.Collections.Generic"/>

<add namespace="System.Collections.Specialized"/>

<add namespace="System.Configuration"/>

<add namespace="System.Text"/>

<add namespace="System.Text.RegularExpressions"/>

<add namespace="System.Web"/>

<add namespace="System.Web.Caching"/>

<add namespace="System.Web.SessionState"/>

<add namespace="System.Web.Security"/>

<add namespace="System.Web.Profile"/>

<add namespace="System.Web.UI"/>

<add namespace="System.Web.UI.WebControls"/>

<add namespace="System.Web.UI.WebControls.WebParts"/>

<add namespace="System.Web.UI.HtmlControls"/>

</namespaces>

</pages>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

--><authentication mode="Forms"/>

 

<
customErrors mode="Off"/>

 

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</system.web>

</configuration>

 

 

Many thanks in advance.

Best Regards,


____________________________________
u dont luv me the way that I luv u !!
0
ujjawal
6/6/2008 9:42:16 AM

Its working fine now with the following web config file....it was the webconfig file that needed some changes....  here is the webconfig file I used and its working fine.....

<?xml version="1.0"?>

<!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure settings for your application. Usethe Website->Asp.Net Configuration option in Visual Studio.A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config <add name="DatabaseConnectionString" connectionString="Data Source=.\SQLEXPRESS;

AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient" />-->

<configuration>

<appSettings/> <configuration>
<appSettings/>
<connectionStrings>
<add name="kcolDatabaseConnectionString" connectionString="Server=mssql.namesco.net;Database=kcoldatabase;uid=kcol2;pwd=****;" providerName="System.Data.SqlClient"/>
<add name="ASPNETDBConnectionString" connectionString="Server=mssql.namesco.net;Database=kcolroles;uid=roles;pwd=****;" providerName="System.Data.SqlClient"/>
</connectionStrings>

 

<system.web><siteMap enabled="true">

<providers>

<add name="MyNewSitemapProvider"

type="System.Web.XmlSiteMapProvider"

siteMapFile="verification.sitemap"/>

</providers>

</siteMap>

<!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only

during development.Visual Basic options:Set strict="true" to disallow all data type conversions where data loss can occur. Set explicit="true" to force declaration of all variables.<customErrors defaultRediret="~/redirect.aspx" /> -->

<compilation debug="true" strict="false" explicit="true">

<assemblies>

<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

<pages>

<namespaces>

<clear/>

<add namespace="System"/>

<add namespace="System.Collections"/>

<add namespace="System.Collections.Generic"/>

<add namespace="System.Collections.Specialized"/>

<add namespace="System.Configuration"/>

<add namespace="System.Text"/>

<add namespace="System.Text.RegularExpressions"/>

<add namespace="System.Web"/>

<add namespace="System.Web.Caching"/>

<add namespace="System.Web.SessionState"/>

<add namespace="System.Web.Security"/>

<add namespace="System.Web.Profile"/>

<add namespace="System.Web.UI"/>

<add namespace="System.Web.UI.WebControls"/>

<add namespace="System.Web.UI.WebControls.WebParts"/>

<add namespace="System.Web.UI.HtmlControls"/>

</namespaces>

</pages><!--The <authentication> section enables configuration f the security authentication mode used by ASP.NET to identify an incoming user. -->

 

<roleManager enabled="true"/>

<authentication mode="Forms">

<forms loginUrl="~/login.aspx" slidingExpiration="true" timeout="60"/>

</authentication><customErrors mode="Off"/>

 

 

<!--
The <customErrors> section enables configuration of what to do if/when an unhandled error occursduring the execution of a request. Specifically,

it enables developers to configure html error pageso be displayed in place of a error stack trace.<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"><error statusCode="403" redirect="NoAccess.htm" /><error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>
--> </system.web>

</configuration>

 

 

 

Now its all working fine. Many thanks to you all....

May god bless us all !!


____________________________________
u dont luv me the way that I luv u !!
0
ujjawal
6/12/2008 10:31:45 AM
Reply:

Similar Artilces:

upgrade error:"CONNECTIVITY ERROR:DB-Library: "SQL Server connection timed out."
PLEASE HELP OH WISE SYBASE GURUS! upgrading 11.9.2 to 12.0. unloaded software. rebooted server. selected "upgrade server" in Configure Sybase Servers window. typed in sa password. got "CONNECTIVITY ERROR: DB-Library: "SQL Server connection timed out." -- Chuck Boyce chuck_boyce@operamail.com http://www.geocities.com/chuck_boyce_jr/ Yahoo Messenger ID: chuck_boyce_jr http://messenger.yahoo.com AOL Instant Messenger ID: sg95m476 http://www.aol.com/aim/ ICQ Messenger ID: 41449031 http://www.icq.com ...

help. when using Profile GetPropertyValue, I get the following connection error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure
 Hi,I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property((string)(this.GetPropertyValue("Address1")));When I look at the stack, it is coming from my ProfileWrapper class which adds user address, city, etc.. from a class which inherits fromSystem.Web.Profile.ProfileBase. From the stack, it is calling the System.Web.Profile and crashed when it tries to open a connection atSystem.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObj...

Started getting a "Unable to establish secure connection with the server" error
I've been working on revising this ASP.NET 2.0 app for the last couple of days.  We've got Windows XP Professional PCs with SP2 installed, and we do our development on those machines.  Yesterday I was working on some of the .aspx pages, saved the changes and ran them, and everything was just fine.  It worked perfectly.  I authenticated against our Active Directory just fine.  However, today when I tried to test it some more I got the following error message, "Unable to establish secure connection with the server" and it highlights the type attribute...

Migration from .net 1.1 to .net 2.0 and deployed in server: error "Server Application Unavilable"
Hi, I have upgraded one .net 1.1 application to .net 2.0. though locally the application is running fine, when deployed in the server it is giving the following error : Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused thi...

VS.NET 2005 is ignoring in web.config strict="true". I get no error when I try this: Dim x As Integer = "string"
Hello,I have this in my VS.NET 2005 web.config <compilation debug="true" strict="true" explicit="true">When I do this in my vb code:Dim x As Integer = "string"I get no error. When I hit compilation I also get no error. What am I doing wrong?Thanks for helping!Regards,J. Bauer It's a bug of some sort See this response by Scott Guthriehttp://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3c1c9898-8076-4f69-a5e2-e99573d03c6e Unfortunately we don’t have a GUI based way to configure this. L It is something we will make sure gets added back in, though, with the next...

Crystal Report Viewer Error: "CRAXDRT Error Occured on Server. 507 : An Exception Occured"
We have recently setup Window Server 2003 SP2 (IIS V6.0) with Crystal Report 8.5 installed. All things working well for report viewer in internet browser, but only the problem is when user trying to export report to a file (CR/word/rich text/etc format) will hit the error:CRAXDRT Error Occurred on Server. 507 : An exception occurredOnly option is click "OK" to continue... Well, so we just click "OK" and try again... Note that, for second tried onward will hit another error:CRAXDRT Error Occurred on Server. 70 : Permission deniedIt was annoying us as export ...

Login Error message "A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1
 Hi all, I was wondering if any body know anything about this problem I'm getting with the login program?Thanks in advance.  A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: A transport-level...

Connecting to Webservice from smartdevice Application in .net gives an error "could not establish connection to network".
Connecting to Webservice from smartdevice Application in .net gives an error "could not establish connection to network".chsk  Check up the following: 1)Internet connection is on & working. 2)Ping the server where the Webservice is hosted on. 3)Try browsing to the Webservice url using pocket IE. If all this tests works fine - then the problem is in your code.   Goodluck  ...

"An IO error has occurred writing to the exception log" Error
I'm getting this error intermittently. Anyone have any ideas why? I have the log folder security in the _default portal set to full for the aspnet user. I've also added the Network group as well with full access. Do I need a Network user? Any help on this would be appreciated. Thanks 1. Are you running Win2000 or Win2003? 2. Is it possible that the file is marked as READ-ONLY? DanDotNetNuke Core Architect 1. I'm running Windows 2000 server 2. No the files are not set as read-only I should clarify this..... dotnetnuke\portals\_default\logs None of the files in this fol...

"Error establishing an encrypted connection. Error code -5891"
Why do I get this frequently when trying to access secure sites? If I use Opera or even IE, I connect just fine. I am using FF v. 1.5.0.4 build 2006050817. I have "Use TSL 1.0", "Use SSL 2.0" and "Use SSL 3.0" all checked in my options. Am I doing or not doing something to cause this? Thank you, BP On Thu, 15 Jun 2006 11:24:36 -0400, BP, That's Me! wrote: >Why do I get this frequently when trying to access secure sites? If I >use Opera or even IE, I connect just fine. > >I am using FF v. 1.5.0.4 build 2006050817. > >I ...

Sub Partition that reports "ERROR: Could not connect to server,Error : -602"
I have a Sub Partition that reports "ERROR: Could not connect to server, Error : -602". Funny thing is one server reports three errors and two other only report one error. The servers not seen (connected to) are in other sub partitions of the Root. Basically I have a Root Partition and four Sub Partitions to the Root. ************************************************************************** NetWare DSRepair 10550.93. DS.NLM 10552.79 Tree name: MYTREE_NAME Server name: .LAUNCHPAD.MYOUNAME.MYONAME NetWare 1602.00 Directory Services Repair 1...

.NET Error Message "Server Error in '/' Application."
I continue to get this error message randomly for several .NET applications and I'm trying to determine if this issue is "Permissions" or "Application Configuration" related.  What are the necessary NTFS security groups and rights that should be applied to the file directories?  Or what is the resolution to resolving this complex problem? HELP! moblack29   The first step is posting the full error message. JeffPlease: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue....

Getting Error "An unhandled error has occurred." when trying to access my dnn
Getting Error "An unhandled error has occurred." when trying to access my dnn.  I have been working one this site for a few days now and everything has been working fine.  I had the website on my \\localhost\wwms but then I changed my default websites home directory so the local path would poing to the same place as \\localhost\wwms did.  Now I get this message, and the browser bar says http://wwmslr/WWMS/Default.aspx?error=Object+reference+not+set+to+an+instance+of+an+object.&content=0 How do I fix this? Thanks Are both websites using the same port?Muhammad FahadPakis...

"A connection with the server could not be established" error opening localhost.
I am trying to open a new Asp.Net application using Visual Studio.Net 2003 on my stand alone home machine.  I am opening it in HTTP://localhost/webnewapp.  Each attempt to open results in an error message saying "A connection with the server could not be established".   I am using Windows XP SP 2, IE 6.0 ASP.net version 1.1.4322.  Have run aspnet_regiis.exe with the -i switch, the -enable switch, the -ir switch and the -r switch.  Have checked the application mappings in the configuration of IIS and they all point to the v1.1.4322 directory.  IIS is...

Web resources about - when i log in, i get the "An error has occurred while establishing a connection to the server" error. - asp.net.config-deploy

Treaty establishing a Constitution for Europe - Wikipedia, the free encyclopedia
The Treaty establishing a Constitution for Europe (TCE), (commonly referred to as the European Constitution or as the Constitutional Treaty ), ...

Establishing Shot: The 405 - Flickr - Photo Sharing!
Photo by Mrs. Newbie. Nearly 15,000 views! This is I-405 on the west side. This is Los Angeles, without a doubt. NOTE: I changed the rights to ...

Successfully Establishing and Representing DevOps in an Audit by James DeLuccia - YouTube
Presented at FlowCon San Francisco 2013 http://flowcon.org/flowcon-sanfran-2013/schedule/index.jsp Organizations and development teams are moving ...

Why NRL should revisit idea of establishing its own TV channel
WAY back in 1994, pay television was but a twinkling in Australia's eye. But ARL head honchos John Quayle and Ken Arthurson had an idea:

France releases case establishing chemical attack against Assad
A FRENCH intelligence report says forces loyal to Bashar al-Assad carried out a "massive" chemical attack last month, as the Syrian leader warned ...

Trade union royal commission: Federal Government establishing police taskforce to investigate corruption ...
... a police taskforce to investigate evidence of criminal conduct uncovered by the trade union royal commission. The Federal Government is establishing ...

Boko Haram says it's establishing Islamic Caliphate in Nigeria
Boko Haram, Nigeria's Islamic extremist rebel group, said it controls the northeastern city of Gwoza and has added it to an Islamic state that ...

Ontario leads way in establishing advisory group on physician-assisted dying
Ontario, with the participation of 11 provinces and territories, is establishing an "expert advisory group" to look at the issues of physician-assisted ...

China Praises Trudeau's Father For His 'Extraordinary Vision' In Establishing Relations
Xi Jinping told Canada's current prime minister that China will never forget Pierre Elliott Trudeau's decision to open diplomatic relations. ...

21 Asian countries sign MOU on establishing AIIB
People's Daily Online 21 Asian countries sign MOU on establishing AIIB People's Daily Online Chinese Finance Minister Lou Jiwei (L front) ...

Resources last updated: 1/9/2016 1:35:14 AM