473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASP.NET 2.0 connecting to SQL Server 2000

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
Sep 9 '06 #1
6 7743
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" <To********@discussions.microsoft.comwrote in message
news:6F**********************************@microsof t.com...
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

Sep 9 '06 #2
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" <To********@discussions.microsoft.comwrote in message
news:6F**********************************@microsof t.com...
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

Sep 9 '06 #3
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:
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
Sep 11 '06 #4
re:
>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/
===================================
<ur*********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
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:
>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

Sep 11 '06 #5
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/
===================================
<ur*********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
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:
>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

Sep 11 '06 #6
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:
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/
===================================
<ur*********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
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:
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
Sep 12 '06 #7

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

Similar topics

4
by: JA | last post by:
Hi, I am total newbie to SQL Server. My new host tells me I can connect through AccessXP or 2002. I have Access 2000. Can I not connect with that also? Thanks, JA
3
by: Ann Marinas | last post by:
Hi there, I am currently developing an ASP.NET program that connects to a SQL Server 2000 database. I also have SQL Server 2005 Express installed on the same local machine. Prior to...
9
by: RvGrah | last post by:
After much hair-pulling, I've finally found the answer to a problem that many are fighting with, difficulty connecting from Sql 2005 Server Management or VS2005 to a remote Sql Server running Sql...
3
by: Vinod R.Shenoy | last post by:
Hi All, Came across a post wherin you had helped somebody with a similar problem and was wondering if you could help us out with it. Our problem is , We have a development SQL Server 2000...
3
by: Chris | last post by:
Don't know if there is a simple solution for this one or not. When running SQL server on a machine with 2000 loaded and the complete SQL package I don't have any issues. Now I'm trying to login...
1
by: =?Utf-8?B?TmVpbCBQYWRkb2Nr?= | last post by:
Using asp.net in Visual Studio 2005, we are getting an error message when trying to connect to an existing SQL 2000 database.. This has only hapenned since we installed the SQL 2005 client tools....
7
by: TerpZebra | last post by:
I am having difficulty connecting to SQL Server 2000 on one of our servers via a VB6 program on Vista. I can connect fine to a different server, but it gives me the following error with the server...
3
by: Me LK | last post by:
I did a search but could not find an aswer that worked so here it goes. I just did an upgrade from 2003 to vs 2005 express. I am using a remote sql server 2000. I specifically upgrade to make...
2
by: orandov | last post by:
Hi, I am having a problem connecting my .net applications from the application server to the database server. When I run the application from my windows xp (sp2) box it works fine. When I try to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.