Connecting Tech Pros Worldwide Help | Site Map

ASP.NET 2.0 connecting to SQL Server 2000

Todd Brewer
Guest
 
Posts: n/a
#1: Sep 9 '06
Windows Server 2000
ASP.NET 2.0
SQL Server 2000 (on a physically seperate server)

I moved an ASP.NET 2.0 application from a development server to production,
and am getting the following error:

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)

This app works fine on a development machine and a development server
hitting an SQL 2000 Server.

I went back to the development server and changed the web.config connection
string to point to the production SQL 2000 Server, and it works fine, so I am
pretty sure the issue is on the production web server. I am using a very
simple connection string:

Data Source=servername;Initial Catalog=catalog;User Id=xxxxx;Password=xxxxx;

I have tried replacing the DataSource as an IP address, with no luck. I
have tried putting 'np:' on the front to force named pipes, with no luck.

This seems to be a very popular issue when I do searches for this error
message. Any help would be GREATLY apprecaited!

Todd
Ken Cox [Microsoft MVP]
Guest
 
Posts: n/a
#2: Sep 9 '06

re: ASP.NET 2.0 connecting to SQL Server 2000


Hi Todd,

You've probably checked but just in case...

Are you sure that the web.config that contains your data connection string
is the one that is actually executing? Be sure that the web is set as an
application in IIS, otherwise a web.config higher up might be the one that's
being used.

Ken
Microsoft MVP [ASP.NET]

"Todd Brewer" <ToddBrewer@discussions.microsoft.comwrote in message
news:6F01F482-EB53-4C2F-8867-516027892642@microsoft.com...
Quote:
Windows Server 2000
ASP.NET 2.0
SQL Server 2000 (on a physically seperate server)
>
I moved an ASP.NET 2.0 application from a development server to
production,
and am getting the following error:
>
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)
>
This app works fine on a development machine and a development server
hitting an SQL 2000 Server.
>
I went back to the development server and changed the web.config
connection
string to point to the production SQL 2000 Server, and it works fine, so I
am
pretty sure the issue is on the production web server. I am using a very
simple connection string:
>
Data Source=servername;Initial Catalog=catalog;User
Id=xxxxx;Password=xxxxx;
>
I have tried replacing the DataSource as an IP address, with no luck. I
have tried putting 'np:' on the front to force named pipes, with no luck.
>
This seems to be a very popular issue when I do searches for this error
message. Any help would be GREATLY apprecaited!
>
Todd

Rob MacFadyen
Guest
 
Posts: n/a
#3: Sep 9 '06

re: ASP.NET 2.0 connecting to SQL Server 2000


Todd,

Are you sure there is network connectivity between your production web
server and your test sql server? More than likely there is a firewall
blocking the connection. On the production server trying pinging the test
sql server. From the production server try "telnet testsqlservername 1433"..
does the screen clear or do you get an error message?

Regards,

Rob


"Todd Brewer" <ToddBrewer@discussions.microsoft.comwrote in message
news:6F01F482-EB53-4C2F-8867-516027892642@microsoft.com...
Quote:
Windows Server 2000
ASP.NET 2.0
SQL Server 2000 (on a physically seperate server)
>
I moved an ASP.NET 2.0 application from a development server to
production,
and am getting the following error:
>
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)
>
This app works fine on a development machine and a development server
hitting an SQL 2000 Server.
>
I went back to the development server and changed the web.config
connection
string to point to the production SQL 2000 Server, and it works fine, so I
am
pretty sure the issue is on the production web server. I am using a very
simple connection string:
>
Data Source=servername;Initial Catalog=catalog;User
Id=xxxxx;Password=xxxxx;
>
I have tried replacing the DataSource as an IP address, with no luck. I
have tried putting 'np:' on the front to force named pipes, with no luck.
>
This seems to be a very popular issue when I do searches for this error
message. Any help would be GREATLY apprecaited!
>
Todd

urban.kaegi@gmail.com
Guest
 
Posts: n/a
#4: Sep 11 '06

re: ASP.NET 2.0 connecting to SQL Server 2000


Hi Todd

I've got exactly the same problem. I tried really a lot of
possibilities to find a workaround, but could not find a working
solution.
I wonder if this problem is not known at Microsoft...
Anyway... I keep on trying and if I find a way to go I'll let you know

Best regards

Urban

Todd Brewer schrieb:
Quote:
Windows Server 2000
ASP.NET 2.0
SQL Server 2000 (on a physically seperate server)
>
I moved an ASP.NET 2.0 application from a development server to production,
and am getting the following error:
>
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)
>
This app works fine on a development machine and a development server
hitting an SQL 2000 Server.
>
I went back to the development server and changed the web.config connection
string to point to the production SQL 2000 Server, and it works fine, so I am
pretty sure the issue is on the production web server. I am using a very
simple connection string:
>
Data Source=servername;Initial Catalog=catalog;User Id=xxxxx;Password=xxxxx;
>
I have tried replacing the DataSource as an IP address, with no luck. I
have tried putting 'np:' on the front to force named pipes, with no luck.
>
This seems to be a very popular issue when I do searches for this error
message. Any help would be GREATLY apprecaited!
>
Todd
Juan T. Llibre
Guest
 
Posts: n/a
#5: Sep 11 '06

re: ASP.NET 2.0 connecting to SQL Server 2000


re:
Quote:
Quote:
>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.
I wonder if this problem is not known at Microsoft...
It is known...and there's a KB with instructions :

http://support.microsoft.com/default...b;EN-US;914277




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<urban.kaegi@gmail.comwrote in message
news:1157999119.258972.257870@i42g2000cwa.googlegr oups.com...
Quote:
Hi Todd
>
I've got exactly the same problem. I tried really a lot of
possibilities to find a workaround, but could not find a working
solution.
I wonder if this problem is not known at Microsoft...
Anyway... I keep on trying and if I find a way to go I'll let you know
>
Best regards
>
Urban
>
Todd Brewer schrieb:
>
Quote:
>Windows Server 2000
>ASP.NET 2.0
>SQL Server 2000 (on a physically seperate server)
>>
>I moved an ASP.NET 2.0 application from a development server to production,
>and am getting the following error:
>>
>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)
>>
>This app works fine on a development machine and a development server
>hitting an SQL 2000 Server.
>>
>I went back to the development server and changed the web.config connection
>string to point to the production SQL 2000 Server, and it works fine, so I am
>pretty sure the issue is on the production web server. I am using a very
>simple connection string:
>>
>Data Source=servername;Initial Catalog=catalog;User Id=xxxxx;Password=xxxxx;
>>
>I have tried replacing the DataSource as an IP address, with no luck. I
>have tried putting 'np:' on the front to force named pipes, with no luck.
>>
>This seems to be a very popular issue when I do searches for this error
>message. Any help would be GREATLY apprecaited!
>>
>Todd
>

Juan T. Llibre
Guest
 
Posts: n/a
#6: Sep 11 '06

re: ASP.NET 2.0 connecting to SQL Server 2000


There's very explicit instructions covering asp.net 2.0/sql server 2000
data connections in this blog entry by Scott Guthrie :

http://weblogs.asp.net/scottgu/archi...25/423703.aspx




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<urban.kaegi@gmail.comwrote in message
news:1157999119.258972.257870@i42g2000cwa.googlegr oups.com...
Quote:
Hi Todd
>
I've got exactly the same problem. I tried really a lot of
possibilities to find a workaround, but could not find a working
solution.
I wonder if this problem is not known at Microsoft...
Anyway... I keep on trying and if I find a way to go I'll let you know
>
Best regards
>
Urban
>
Todd Brewer schrieb:
>
Quote:
>Windows Server 2000
>ASP.NET 2.0
>SQL Server 2000 (on a physically seperate server)
>>
>I moved an ASP.NET 2.0 application from a development server to production,
>and am getting the following error:
>>
>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)
>>
>This app works fine on a development machine and a development server
>hitting an SQL 2000 Server.
>>
>I went back to the development server and changed the web.config connection
>string to point to the production SQL 2000 Server, and it works fine, so I am
>pretty sure the issue is on the production web server. I am using a very
>simple connection string:
>>
>Data Source=servername;Initial Catalog=catalog;User Id=xxxxx;Password=xxxxx;
>>
>I have tried replacing the DataSource as an IP address, with no luck. I
>have tried putting 'np:' on the front to force named pipes, with no luck.
>>
>This seems to be a very popular issue when I do searches for this error
>message. Any help would be GREATLY apprecaited!
>>
>Todd
>

dosborn278@hotmail.com
Guest
 
Posts: n/a
#7: Sep 12 '06

re: ASP.NET 2.0 connecting to SQL Server 2000


Also verify you connection string is proper and you have connectivity
to the test sql server from the machine by building a .udl file and
doing a test. The .udl will allow you to more easily make tweaks
instead of continuing to change your web.config, and will test the
connectivity to the SQL server as opposed to just checking access to
the machine via a ping request.

You can look at this for an example...

http://www.ctrlalt313373.com/DavidsB...3/Default.aspx


Juan T. Llibre wrote:
Quote:
There's very explicit instructions covering asp.net 2.0/sql server 2000
data connections in this blog entry by Scott Guthrie :
>
http://weblogs.asp.net/scottgu/archi...25/423703.aspx
>
>
>
>
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
<urban.kaegi@gmail.comwrote in message
news:1157999119.258972.257870@i42g2000cwa.googlegr oups.com...
Quote:
Hi Todd

I've got exactly the same problem. I tried really a lot of
possibilities to find a workaround, but could not find a working
solution.
I wonder if this problem is not known at Microsoft...
Anyway... I keep on trying and if I find a way to go I'll let you know

Best regards

Urban

Todd Brewer schrieb:
Quote:
Windows Server 2000
ASP.NET 2.0
SQL Server 2000 (on a physically seperate server)
>
I moved an ASP.NET 2.0 application from a development server to production,
and am getting the following error:
>
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)
>
This app works fine on a development machine and a development server
hitting an SQL 2000 Server.
>
I went back to the development server and changed the web.config connection
string to point to the production SQL 2000 Server, and it works fine, so I am
pretty sure the issue is on the production web server. I am using a very
simple connection string:
>
Data Source=servername;Initial Catalog=catalog;User Id=xxxxx;Password=xxxxx;
>
I have tried replacing the DataSource as an IP address, with no luck. I
have tried putting 'np:' on the front to force named pipes, with no luck.
>
This seems to be a very popular issue when I do searches for this error
message. Any help would be GREATLY apprecaited!
>
Todd
Closed Thread