473,897 Members | 2,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error "SQL Server does not allow remote connections"

I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.

NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.

Now I'm getting this error. Any idea why?

Server Error in '/myuser4/MyWebApp' 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.Sql Client.SqlExcep tion: 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 4:
Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Line 6: If User.IsInRole(" LexAdmin") Or
User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
Line 7: Response.Redire ct("admin/ManagePackages. aspx")
Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
Line: 6

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.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +800131
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj) +186
System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
integratedSecur ity, SqlConnection owningObject) +737554
System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
timerExpire, SqlConnection owningObject) +114
System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart) +381
System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
Boolean redirectedUserI nstance) +181
System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
+173
System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
owningConnectio n) +133
System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject) +424
System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject) +66
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject) +494
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n) +82
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
Boolean revertImpersona te) +84
System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
connectionStrin g, Boolean revertImpersona tion) +197
System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username) +771
System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
loginredirect.P age_Load(Object sender, EventArgs e) in
d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1436


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
ASP.NET Version:2.0.507 27.1433
Jun 27 '08 #1
5 3566
By default SQl2005 does not accept remote connections e.g when they are made
with remote IP (not with local IP address). E.g first check that you have
correct IP.

This remote connection allowing is configured with SQL Server's Surface
Area configuration tool (there are selections Local connections Only/Local
and remote connections). In case this isn't something you can control, I
suggest you contact your host

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Cirene" <ci****@nowhere .comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.

NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.

Now I'm getting this error. Any idea why?

Server Error in '/myuser4/MyWebApp' 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.Sql Client.SqlExcep tion: 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 4:
Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Line 6: If User.IsInRole(" LexAdmin") Or
User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
Line 7: Response.Redire ct("admin/ManagePackages. aspx")
Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
Line: 6

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.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +800131

System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj) +186
System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
integratedSecur ity, SqlConnection owningObject) +737554

System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
timerExpire, SqlConnection owningObject) +114
System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
+381

System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
Boolean redirectedUserI nstance) +181

System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserI nstance) +173

System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
owningConnectio n) +133

System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject) +424
System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject) +66
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject) +494
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n) +82
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
Boolean revertImpersona te) +84
System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
connectionStrin g, Boolean revertImpersona tion) +197
System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
+771
System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
loginredirect.P age_Load(Object sender, EventArgs e) in
d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1436


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
ASP.NET Version:2.0.507 27.1433

Jun 27 '08 #2
the error means that connection to the sqlserver could not be made (name
resolution or socket open failed). assuming the sqlserver is configured,
either you have the connection string wrong (name and port number) or the
network is blocking the connection (firewall rules).

-- bruce (sqlwork.com)
"Cirene" wrote:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.

NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.

Now I'm getting this error. Any idea why?

Server Error in '/myuser4/MyWebApp' 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.Sql Client.SqlExcep tion: 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 4:
Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Line 6: If User.IsInRole(" LexAdmin") Or
User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
Line 7: Response.Redire ct("admin/ManagePackages. aspx")
Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
Line: 6

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.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +800131
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj) +186
System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
integratedSecur ity, SqlConnection owningObject) +737554
System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
timerExpire, SqlConnection owningObject) +114
System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart) +381
System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
Boolean redirectedUserI nstance) +181
System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
+173
System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
owningConnectio n) +133
System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject) +424
System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject) +66
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject) +494
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n) +82
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
Boolean revertImpersona te) +84
System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
connectionStrin g, Boolean revertImpersona tion) +197
System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username) +771
System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
loginredirect.P age_Load(Object sender, EventArgs e) in
d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1436


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
ASP.NET Version:2.0.507 27.1433
Jun 27 '08 #3
From error "...provide r: Named Pipes Provider" I understand that you using
Named Pipes protocol and not TCP/IP.

Named pipes protocol works well only in Domain environment.
It has embedded NT authentication. So if guest account disabled on the
server then Named pipes connection will be refused.

You need to switch it to TCP/IP
Try to add "Network Library=DBMSSOC N" to your connection string
"Data Source=190.190. 200.100,1433;Ne twork Library=DBMSSOC N;Initial
Catalog=myDataB ase;User ID=myUsername;P assword=myPassw ord;"

George.
"bruce barker" <br*********@di scussions.micro soft.comwrote in message
news:EC******** *************** ***********@mic rosoft.com...
the error means that connection to the sqlserver could not be made (name
resolution or socket open failed). assuming the sqlserver is configured,
either you have the connection string wrong (name and port number) or the
network is blocking the connection (firewall rules).

-- bruce (sqlwork.com)
"Cirene" wrote:
>I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.

NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.

Now I'm getting this error. Any idea why?

Server Error in '/myuser4/MyWebApp' 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.Sql Client.SqlExcep tion: 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 4:
Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventAr gs) Handles Me.Load
Line 6: If User.IsInRole(" LexAdmin") Or
User.IsInRole( "LexOperato r") Or User.IsInRole(" LexUser") Then
Line 7: Response.Redire ct("admin/ManagePackages. aspx")
Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
User.IsInRole( "CustomerClient ") Or User.IsInRole(" CustomerUser") Then
Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
Line: 6

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.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +800131

System.Data.Sq lClient.TdsPars er.ThrowExcepti onAndWarning(Td sParserStateObj ect
stateObj) +186
System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
SqlInternalCon nectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
integratedSecu rity, SqlConnection owningObject) +737554

System.Data.Sq lClient.SqlInte rnalConnectionT ds.AttemptOneLo gin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
timerExpire, SqlConnection owningObject) +114
System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
owningObject , SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
+381

System.Data.Sq lClient.SqlInte rnalConnectionT ds.OpenLoginEnl ist(SqlConnecti on
owningObject , SqlConnectionSt ring connectionOptio ns, String newPassword,
Boolean redirectedUserI nstance) +181

System.Data.Sq lClient.SqlInte rnalConnectionT ds..ctor(DbConn ectionPoolIdent ity
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String
newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
+173

System.Data.Sq lClient.SqlConn ectionFactory.C reateConnection (DbConnectionOp tions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
DbConnection
owningConnecti on) +133

System.Data.Pr oviderBase.DbCo nnectionFactory .CreatePooledCo nnection(DbConn ection
owningConnecti on, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject ) +424

System.Data.Pr oviderBase.DbCo nnectionPool.Us erCreateRequest (DbConnection
owningObject ) +66
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject ) +494

System.Data.Pr oviderBase.DbCo nnectionFactory .GetConnection( DbConnection
owningConnecti on) +82

System.Data.Pr oviderBase.DbCo nnectionClosed. OpenConnection( DbConnection
outerConnectio n, DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
Boolean revertImpersona te) +84
System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
connectionStri ng, Boolean revertImpersona tion) +197
System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
+771
System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
loginredirect.P age_Load(Object sender, EventArgs e) in
d:\hosting\mem ber\myuser4\MyW ebApp\loginredi rect.aspx.vb:6
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesB eforeAsyncPoint , Boolean includeStagesAf terAsyncPoint)
+1436


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
ASP.NET Version:2.0.507 27.1433

Jun 27 '08 #4
I'm using the exact connection string (different db of course) of other
websites that ARE working.

Is this wierd? Any more ideas?

Thanks!

"bruce barker" <br*********@di scussions.micro soft.comwrote in message
news:EC******** *************** ***********@mic rosoft.com...
the error means that connection to the sqlserver could not be made (name
resolution or socket open failed). assuming the sqlserver is configured,
either you have the connection string wrong (name and port number) or the
network is blocking the connection (firewall rules).

-- bruce (sqlwork.com)
"Cirene" wrote:
>I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.

NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.

Now I'm getting this error. Any idea why?

Server Error in '/myuser4/MyWebApp' 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.Sql Client.SqlExcep tion: 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 4:
Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventAr gs) Handles Me.Load
Line 6: If User.IsInRole(" LexAdmin") Or
User.IsInRole( "LexOperato r") Or User.IsInRole(" LexUser") Then
Line 7: Response.Redire ct("admin/ManagePackages. aspx")
Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
User.IsInRole( "CustomerClient ") Or User.IsInRole(" CustomerUser") Then
Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
Line: 6

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.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +800131

System.Data.Sq lClient.TdsPars er.ThrowExcepti onAndWarning(Td sParserStateObj ect
stateObj) +186
System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
SqlInternalCon nectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
integratedSecu rity, SqlConnection owningObject) +737554

System.Data.Sq lClient.SqlInte rnalConnectionT ds.AttemptOneLo gin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
timerExpire, SqlConnection owningObject) +114
System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
owningObject , SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
+381

System.Data.Sq lClient.SqlInte rnalConnectionT ds.OpenLoginEnl ist(SqlConnecti on
owningObject , SqlConnectionSt ring connectionOptio ns, String newPassword,
Boolean redirectedUserI nstance) +181

System.Data.Sq lClient.SqlInte rnalConnectionT ds..ctor(DbConn ectionPoolIdent ity
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String
newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
+173

System.Data.Sq lClient.SqlConn ectionFactory.C reateConnection (DbConnectionOp tions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
DbConnection
owningConnecti on) +133

System.Data.Pr oviderBase.DbCo nnectionFactory .CreatePooledCo nnection(DbConn ection
owningConnecti on, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject ) +424

System.Data.Pr oviderBase.DbCo nnectionPool.Us erCreateRequest (DbConnection
owningObject ) +66
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject ) +494

System.Data.Pr oviderBase.DbCo nnectionFactory .GetConnection( DbConnection
owningConnecti on) +82

System.Data.Pr oviderBase.DbCo nnectionClosed. OpenConnection( DbConnection
outerConnectio n, DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
Boolean revertImpersona te) +84
System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
connectionStri ng, Boolean revertImpersona tion) +197
System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
+771
System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
loginredirect.P age_Load(Object sender, EventArgs e) in
d:\hosting\mem ber\myuser4\MyW ebApp\loginredi rect.aspx.vb:6
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesB eforeAsyncPoint , Boolean includeStagesAf terAsyncPoint)
+1436


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
ASP.NET Version:2.0.507 27.1433

Jun 27 '08 #5
Hello Cirene,

I have had similar experience with 1and1.com.

I had a hosting account with them and decided to connect my application that
was hosted somewhere else to the sql server database i have with them.

The application could not connect to the sql server db. Some hosting may
require that your application be hosted on their enviroment before you can
access the sql server database.

You can also check how you're managing the roles. Are you using an attached
database to manage the roles? If yes, you have to grant ASP.NET access to the
folder containing the database file.

Thank you,
Okoronkwo Alfred Chinedu
--
Okoronkwo Chinedu
Crazy About Learning
"Cirene" wrote:
I'm using the exact connection string (different db of course) of other
websites that ARE working.

Is this wierd? Any more ideas?

Thanks!

"bruce barker" <br*********@di scussions.micro soft.comwrote in message
news:EC******** *************** ***********@mic rosoft.com...
the error means that connection to the sqlserver could not be made (name
resolution or socket open failed). assuming the sqlserver is configured,
either you have the connection string wrong (name and port number) or the
network is blocking the connection (firewall rules).

-- bruce (sqlwork.com)
"Cirene" wrote:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.

NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.

Now I'm getting this error. Any idea why?

Server Error in '/myuser4/MyWebApp' 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.Sql Client.SqlExcep tion: 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 4:
Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Line 6: If User.IsInRole(" LexAdmin") Or
User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
Line 7: Response.Redire ct("admin/ManagePackages. aspx")
Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
Line: 6

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.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection ) +800131

System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj) +186
System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
integratedSecur ity, SqlConnection owningObject) +737554

System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
timerExpire, SqlConnection owningObject) +114
System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
+381

System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
Boolean redirectedUserI nstance) +181

System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
String
newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
+173

System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
DbConnection
owningConnectio n) +133

System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
owningObject) +424

System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
owningObject) +66
System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
owningObject) +494

System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
owningConnectio n) +82

System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
Boolean revertImpersona te) +84
System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
connectionStrin g, Boolean revertImpersona tion) +197
System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
+771
System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
loginredirect.P age_Load(Object sender, EventArgs e) in
d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
+1436


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
ASP.NET Version:2.0.507 27.1433


Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2470
by: Chumley the Walrus | last post by:
I don't have necessary rights on my local machine at work to use SQL administrative "sa" and password when utilizing sql connections. My Windows network username and password does allow me to connect to local SQL database (MDSE) when I view the database scheme in visualstudio.net (PROG1\NETSDK ). When I need to create an sql connection string, : using System.Data.SqlClient; string source = "server=(local)\\NetSDK;" +
6
2016
by: John Baker | last post by:
Hi: Does "On Open" code execute before or after related data is loaded? I want to test before the form appears on the screen to see if there is any data in the queryresult, and if there is not then I want to close the form unseen by the end user. Regards John baker
4
4633
by: Bruce A. Julseth | last post by:
This is my 2nd request. Is the question too vague? Or, too difficult to answer. I'm really a newbie at this VS.NET stuff and do appreciate some help on this problem.---I keep getting the error "Unable to Start Debugging on the Web Server." I am on a standalone, non networked computer running XP Professonal and VS.net, and doing my development using VS.C#. I "think" I have gone through eveything listed in help for this error, but...
0
18466
by: BGS | last post by:
I have a web site (www.on-the-matrix.com) that displays photos in a "slide show" format on ASPX pages that run in an inline frame on an ASP page (or in a separate pop-up window). The ASPX pages use a hidden form to transmit information back to the server so it will know which is the next photo to load. All of this works as intended in modern versions of Internet Explorer, Netscape and Mozilla. With Opera, however, users receive a...
2
10795
by: Rossco | last post by:
I have a VB.NET serviced component (COM+), running on a lan, that calls out to an external web service to place an order with a supplier. The problem machine is the middle tier (COM+) for our in house applications, and also has a mail server to service a 100 stores (don't ask me why, I don't like this either). The call to the webservice works correctly on our test COM+ machine but fails on the production machine with the above error. ...
5
14439
by: Glen Buell | last post by:
Hi all, I have a major problem with my ASP.NET website and it's SQL Server 2005 Express database, and I'm wondering if anyone could help me out with it. This site is on a webhost (WebHost4Life) and was running fine and dandy, until I decided I needed to add some additional stored procedures to the database.
2
7958
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer. When someone else uses the web app and tries to open a file using the remote server the error below happens. any help? **Code** C# - filepath is a valid file name which is passed via the form. System.IO.BinaryReader br = new...
6
13699
by: Patrick.Simons | last post by:
I try to connect a FTPWebRequest through Proxy and VPN to a remote FTP- server. Sometimes it works sometimes not. When my VB.Net-App (2005) returns the error on the GetResponse-Method, I'll try to use the Windows Explorer to go on the FTP-URI and this always works. So the problem should come from my app. my simplified code: Private m_oFTP As FtpWebRequest Private oResponseDir As FtpWebResponse = Nothing
0
2588
by: johnyjj2 | last post by:
Hello! I'd like to run mssql script (file with extension sql). I installed Microsoft SQL Server 2008 and run in Command Prompt: C:\Documents and Settings\useruser>osql -Usa -Ppassword -i "F:\Data\MyApplication\Scripts\CreateDb.sql" Named Pipes Provider: Could not open a connection to SQL Server . Login timeout expired A network-related or instance-specific error has occured while establishing a connection to SQL Server. Server is not...
0
9837
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11250
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10939
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10476
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8031
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7183
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6073
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4292
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3299
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.