Showing posts with label establishing. Show all posts
Showing posts with label establishing. Show all posts

Thursday, March 8, 2012

An error has occurred while establishing a connection to the server. When connecting to SQ

I get the following error and have been trying to figure out why I keep getting it. Initially, I had placed my project under wwwroot folder and ran it under IIS and it gave this error. Then I moved it to my local C drive and same thing. I am sharing this project with two other co-workers and all our config files and code files are same...they don't get this error but I do. I checked that SQL Server Client Network Utility has TCP/IP and the 'Named Pipes' enabled. I thought maybe I have setting in the Visual Studio 2005 that I'm not aware of that's causing this problem...it can't be the server since my co-workers aren't having this error and can't be anything in the code since all of us are sharing this project through vss. I dont' think using different version of .net framework can create this error. I changed the version from 2.0 to use 1.1x and it gave same error... Any help would be greatly appreciated. Thanks in advance.

Server Error in '/RBOdev' 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) +739123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +685966 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +109 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383 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) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 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.UI.WebControls.WebParts.SqlPersonalizationProvider.GetConnectionHolder() +16 System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider.LoadPersonalizationBlobs(WebPartManager webPartManager, String path, String userName, Byte[]& sharedDataBlob, Byte[]& userDataBlob) +195 System.Web.UI.WebControls.WebParts.PersonalizationProvider.LoadPersonalizationState(WebPartManager webPartManager, Boolean ignoreCurrentUser) +95 System.Web.UI.WebControls.WebParts.WebPartPersonalization.Load() +105 System.Web.UI.WebControls.WebParts.WebPartManager.OnInit(EventArgs e) +497 System.Web.UI.Control.InitRecursive(Control namingContainer) +321 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Control.InitRecursive(Control namingContainer) +198 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692



Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

I actually figured out the problem. Under the <asp:WebpartManger> control, I had to specify Personalization-Enabled to "False"...I guess by default, if it is not set, it will be true...in that case, it'll look for a database in SQL Server 2005 which I"m not using...my database that I'm connecting to is in SQL Server 2000. However, the only thing that is still not clear to me is that my two other co-workers are sharing the same project with me using VSS. All their settings are the same as mine and clearly they had the WebpartManger and property for personalization was not set to false...but they did not get this error...why was I the only one getting it? Is there another location where the personalization property can be set to false? Thanks...

|||

Hi,

From your description, it seems that you are using WebParts feature in your website project, right?

Generally, when you are using WebParts in your application, it requires SQLExpress database, which is a built-in database in Microsoft Visual Studio 2005. Since webparts need personalization features , and all these personalization data would be stored in database.

Besides, in webparts there are several modes, including Browser,Design,Cateloge and etc. When you are in Browser mode, the personalization feature can be set in false status. But for other modes, it requires the personalization and database support.

Also, if you want to achieve personalization on the machine with a SQLServer 2000, you can use aspnet_regsql.exe tool to convert the ASPNETDB database in SQLExpress to your SQLServer database, and change the corresponding provider to achieve your personalization.

Thanks.

An error has occurred while establishing a connection to the server. error: 40

hi i got the following error message while connectiong to my sql server 2005

NB :i am connecting from the same pc where sq server is installed.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

Any idea?

Tarek

If you're using SQL Server 2005 Express, and you did the default install, and you're trying to connect using the sqlcmd utility, then you need to start sqlcmd like this:-

sqlcmd -S .\SQLEXPRESS

This is because the default for SQL Server Express is to install a named instance called SQLEXPRESS instead of the 'default' instance installed by other versions of SQL Server 2005.

|||I am using sql 2005 Enterprise editon on my laptop and I get the sam error. If someone knows how to resolve the problem please help, before sql 2005 I had sql 2000 installed. Thnx in advance .|||

Add me to the list of people having this problem.

Wylbur
============================

|||I installed sql server 2000 and run it. The problem solved. But I have to keep the 2000 running, otherwise, the problem will reappear.
|||Now THAT is vel-ly in-ter-es-tink.

OK guys: Does this suggest that there is a needed service that should be running at startup
but isn't?

... and, if so, which one(s)?

Wylbur
========================

|||

You can look at this blog for information on enabling remote connects. The blog is for the Express edition but this posting is applicable to all editions: https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Cheers,
Dan

|||

Having the same problem... here is how i resolved it.

Start -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server 2005 Surface Area Configuration.

Configure Surface Area for localhost -> Surface Area Configuration for Services and Connections

MSSQLSERVER + Database Engine -> Remote Connections

Select 'Local and remote connections' instead of 'Local connections only'

Select the appropriate option under this option, i picked Using both TCP/IP and named pipes.

An error has occurred while establishing a connection to the server. error: 40

hi i got the following error message while connectiong to my sql server 2005

NB :i am connecting from the same pc where sq server is installed.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

Any idea?

Tarek

If you're using SQL Server 2005 Express, and you did the default install, and you're trying to connect using the sqlcmd utility, then you need to start sqlcmd like this:-

sqlcmd -S .\SQLEXPRESS

This is because the default for SQL Server Express is to install a named instance called SQLEXPRESS instead of the 'default' instance installed by other versions of SQL Server 2005.

|||I am using sql 2005 Enterprise editon on my laptop and I get the sam error. If someone knows how to resolve the problem please help, before sql 2005 I had sql 2000 installed. Thnx in advance .|||

Add me to the list of people having this problem.

Wylbur
============================

|||I installed sql server 2000 and run it. The problem solved. But I have to keep the 2000 running, otherwise, the problem will reappear.
|||Now THAT is vel-ly in-ter-es-tink.

OK guys: Does this suggest that there is a needed service that should be running at startup
but isn't?

... and, if so, which one(s)?

Wylbur
========================

|||

You can look at this blog for information on enabling remote connects. The blog is for the Express edition but this posting is applicable to all editions: https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Cheers,
Dan

|||

Having the same problem... here is how i resolved it.

Start -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server 2005 Surface Area Configuration.

Configure Surface Area for localhost -> Surface Area Configuration for Services and Connections

MSSQLSERVER + Database Engine -> Remote Connections

Select 'Local and remote connections' instead of 'Local connections only'

Select the appropriate option under this option, i picked Using both TCP/IP and named pipes.

An error has occurred while establishing a connection to the server. error: 40

hi i got the following error message while connectiong to my sql server 2005

NB :i am connecting from the same pc where sq server is installed.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

Any idea?

Tarek

If you're using SQL Server 2005 Express, and you did the default install, and you're trying to connect using the sqlcmd utility, then you need to start sqlcmd like this:-

sqlcmd -S .\SQLEXPRESS

This is because the default for SQL Server Express is to install a named instance called SQLEXPRESS instead of the 'default' instance installed by other versions of SQL Server 2005.

|||I am using sql 2005 Enterprise editon on my laptop and I get the sam error. If someone knows how to resolve the problem please help, before sql 2005 I had sql 2000 installed. Thnx in advance .|||

Add me to the list of people having this problem.

Wylbur
============================

|||I installed sql server 2000 and run it. The problem solved. But I have to keep the 2000 running, otherwise, the problem will reappear.
|||Now THAT is vel-ly in-ter-es-tink.

OK guys: Does this suggest that there is a needed service that should be running at startup
but isn't?

... and, if so, which one(s)?

Wylbur
========================

|||

You can look at this blog for information on enabling remote connects. The blog is for the Express edition but this posting is applicable to all editions: https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Cheers,
Dan

|||

Having the same problem... here is how i resolved it.

Start -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server 2005 Surface Area Configuration.

Configure Surface Area for localhost -> Surface Area Configuration for Services and Connections

MSSQLSERVER + Database Engine -> Remote Connections

Select 'Local and remote connections' instead of 'Local connections only'

Select the appropriate option under this option, i picked Using both TCP/IP and named pipes.

An error has occurred while establishing a connection to the server

Hi I have just reinstalled .Net and SqlServer2005. I am running my application from local machine and sqlserver is also install local machine. but when I run application. Get follwing Error MessageSad

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)

What was the application trying to do when you got this message? It may be that the connection string is not correct, it may be that the server is setup for only windows authentication.

|||

Hi

From your description, it seems that you met error when you are trying to connect to your SQLServer,right?

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)

For this kind of issue, we should use the following steps to diagnose the problem.

First, you also should make sure that if 1433 port has been enabled on your server, which is the default port for SQLServer remote connections.

Generally, you can try the following ways to handle your problem.

1. Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition
2. Enable the SQL Server Browser service
3. Create exceptions in Windows Firewall
4. Create an exception for SQL Server 2005 in Windows Firewall
5. Create an exception for the SQL Server Browser service in Windows Firewall

More details for each step, you may see the following link:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

Thanks.

An error has occurred while establishing a connection to the serve

Server Error in '/indiatest' 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: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)
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: Named Pipes
Provider, error: 40 - Could not open a connection to SQL Server)
Source Error:
Line 47: vSQL="select max(pdate) from uploadlog where
logreport='Salesorder Upload Completed'"
Line 48: objCmd = New SqlCommand(vSQL, objConn)
Line 49: objConn.Open()
Line 50: dataReader = objCmd.ExecuteReader()
Line 51:
Source File: D:\indiatest\login1.aspx Line: 49
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: Named Pipes Provider, error: 40 - Could
not open a connection to SQL Server)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj) +188
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
integratedSecurity, SqlConnection owningObject) +685966
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject) +109
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
ASP.login1_aspx.ftip(Object Src, EventArgs E) in
D:\indiatest\login1.aspx:49
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET
Version:2.0.50727.832
Error you get is all about the connection to your SQL Server instance.
I wish you'd share the Connection String with us. Then it would be easier to
track the path.
Ensure you enter the right info to the Server property in your Connection
String. If your SQL Server instance is a Named instance then you should
enter this info as "ServerName\NamedInstance", if it's a Default Instance
then only the ServerName would be enough.
Is this your server, or a server of a hosting company? If it's yours and
ensure that you set the Firewall settings of the Windows Server to allow the
port that your SQL Server instance uses. And ensure you enabled TCP protocol
and configured it well. Ensure you use a static port for this purpose (if
it's a Default Instance then it'll be using 1433 static port, if it's a
Named Instance then it'll be using a Dynamic Port by default)
Ekrem ?nsoy
"Yogesh Bate" <YogeshBate@.discussions.microsoft.com> wrote in message
news:02D393E8-F9BA-4D5F-9BF3-CD57E336356E@.microsoft.com...
> Server Error in '/indiatest' 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: Named Pipes Provider, error: 40 - Could not open a connection
> to
> SQL Server)
> 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: Named Pipes
> Provider, error: 40 - Could not open a connection to SQL Server)
> Source Error:
>
> Line 47: vSQL="select max(pdate) from uploadlog where
> logreport='Salesorder Upload Completed'"
> Line 48: objCmd = New SqlCommand(vSQL, objConn)
> Line 49: objConn.Open()
> Line 50: dataReader = objCmd.ExecuteReader()
> Line 51:
>
> Source File: D:\indiatest\login1.aspx Line: 49
> 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: Named Pipes Provider, error: 40 -
> Could
> not open a connection to SQL Server)]
> System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
> exception, Boolean breakConnection) +739123
> System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
> stateObj) +188
> System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
> SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64
> timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
> integratedSecurity, SqlConnection owningObject) +685966
> System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo
> serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
> timerExpire, SqlConnection owningObject) +109
> System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String
> host, String newPassword, Boolean redirectedUserInstance, SqlConnection
> owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
> +383
> System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
> owningObject, SqlConnectionString connectionOptions, String newPassword,
> Boolean redirectedUserInstance) +181
> System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
> identity, SqlConnectionString connectionOptions, Object providerInfo,
> String
> newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
> +170
> System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
> options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
> owningConnection) +359
> System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection
> owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
> System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
> owningObject) +424
> System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
> owningObject) +66
> System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
> owningObject) +496
> System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
> owningConnection) +82
> System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
> outerConnection, DbConnectionFactory connectionFactory) +105
> System.Data.SqlClient.SqlConnection.Open() +111
> ASP.login1_aspx.ftip(Object Src, EventArgs E) in
> D:\indiatest\login1.aspx:49
> System.Web.UI.Control.OnLoad(EventArgs e) +99
> System.Web.UI.Control.LoadRecursive() +47
> System.Web.UI.Control.LoadRecursive() +131
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
>
>
> ----
> Version Information: Microsoft .NET Framework Version:2.0.50727.832;
> ASP.NET
> Version:2.0.50727.832

An error has occurred while establishing a connection to the serve

Server Error in '/indiatest' 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: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)
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: Named Pipes
Provider, error: 40 - Could not open a connection to SQL Server)
Source Error:
Line 47: vSQL="select max(pdate) from uploadlog where
logreport='Salesorder Upload Completed'"
Line 48: objCmd = New SqlCommand(vSQL, objConn)
Line 49: objConn.Open()
Line 50: dataReader = objCmd.ExecuteReader()
Line 51:
Source File: D:\indiatest\login1.aspx Line: 49
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: Named Pipes Provider, error: 40 - Could
not open a connection to SQL Server)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +188
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
integratedSecurity, SqlConnection owningObject) +685966
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject) +109
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383
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) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
ASP.login1_aspx.ftip(Object Src, EventArgs E) in
D:\indiatest\login1.aspx:49
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
----
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET
Version:2.0.50727.832Error you get is all about the connection to your SQL Server instance.
I wish you'd share the Connection String with us. Then it would be easier to
track the path.
Ensure you enter the right info to the Server property in your Connection
String. If your SQL Server instance is a Named instance then you should
enter this info as "ServerName\NamedInstance", if it's a Default Instance
then only the ServerName would be enough.
Is this your server, or a server of a hosting company? If it's yours and
ensure that you set the Firewall settings of the Windows Server to allow the
port that your SQL Server instance uses. And ensure you enabled TCP protocol
and configured it well. Ensure you use a static port for this purpose (if
it's a Default Instance then it'll be using 1433 static port, if it's a
Named Instance then it'll be using a Dynamic Port by default)
--
Ekrem Ã?nsoy
"Yogesh Bate" <YogeshBate@.discussions.microsoft.com> wrote in message
news:02D393E8-F9BA-4D5F-9BF3-CD57E336356E@.microsoft.com...
> Server Error in '/indiatest' 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: Named Pipes Provider, error: 40 - Could not open a connection
> to
> SQL Server)
> 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: Named Pipes
> Provider, error: 40 - Could not open a connection to SQL Server)
> Source Error:
>
> Line 47: vSQL="select max(pdate) from uploadlog where
> logreport='Salesorder Upload Completed'"
> Line 48: objCmd = New SqlCommand(vSQL, objConn)
> Line 49: objConn.Open()
> Line 50: dataReader = objCmd.ExecuteReader()
> Line 51:
>
> Source File: D:\indiatest\login1.aspx Line: 49
> 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: Named Pipes Provider, error: 40 -
> Could
> not open a connection to SQL Server)]
> System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
> exception, Boolean breakConnection) +739123
> System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
> stateObj) +188
> System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
> SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64
> timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
> integratedSecurity, SqlConnection owningObject) +685966
> System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
> serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
> timerExpire, SqlConnection owningObject) +109
> System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
> host, String newPassword, Boolean redirectedUserInstance, SqlConnection
> owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
> +383
> 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)
> +170
> System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
> options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
> owningConnection) +359
> System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
> owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
> System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
> owningObject) +424
> System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
> owningObject) +66
> System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
> owningObject) +496
> System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
> owningConnection) +82
> System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
> outerConnection, DbConnectionFactory connectionFactory) +105
> System.Data.SqlClient.SqlConnection.Open() +111
> ASP.login1_aspx.ftip(Object Src, EventArgs E) in
> D:\indiatest\login1.aspx:49
> System.Web.UI.Control.OnLoad(EventArgs e) +99
> System.Web.UI.Control.LoadRecursive() +47
> System.Web.UI.Control.LoadRecursive() +131
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
>
>
> ----
> Version Information: Microsoft .NET Framework Version:2.0.50727.832;
> ASP.NET
> Version:2.0.50727.832