By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

ASP.NET 2.0/SQL Server 2000 Connection Problem.

P: n/a
Hi All,
I have an ASP.NET 2.0 web application on a web server and a separate machine
for SQL Server 2000 Database. I am using a Connectionstring based on Sql
Authentication to connect to the the SQL 2000 Database.

Now, When I open the web page on the Web Server itself, I am able to
successfully connect to the Database which confirms that the connection
string is correct. However when I open the same web page from another client
machine other than the web server, I get the following error message:

"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) - .Net SqlClient Data Provider"

if I try to force TCP/IP specifying "Network Library=DBMSSOCN;" then it does
not work at all from any machine and I get the following error:
"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: TCP Provider, error: 0 - No connection could be made because the
target machine actively refused it.) - Net SqlClient Data Provider"

SQL Server is on default port 1433 and both TCP/IP and Named Pipes protocols
are enabled.
Any advice on this is much appreciated.

Thanks,
Vikram

Jun 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rule #1. Always use TCP/IP to connect to SQL from ASP.NET
So keep Network Library=DBMSSOCN and make it work with it.
----------------------------------------

You need to enable TCP/IP on MS SQL side.
Right click on SQL server in SQL Server enterprise manager. Tab "General".
Button "Network Configuration"
Make sure you have TCP/IP in enabled protocols.

Also make sure that if there is any firewall between Web server and SQL then
it's open. Also try to ping the SQL server from Web server. Sometimes web
server can not resolve the name of the SQL server due to the network
configuration. Fix it or use IP address.

George.
"Vikram S" <vi*******@hotmail.comwrote in message
news:E8**********************************@microsof t.com...
Hi All,
I have an ASP.NET 2.0 web application on a web server and a separate
machine for SQL Server 2000 Database. I am using a Connectionstring based
on Sql Authentication to connect to the the SQL 2000 Database.

Now, When I open the web page on the Web Server itself, I am able to
successfully connect to the Database which confirms that the connection
string is correct. However when I open the same web page from another
client machine other than the web server, I get the following error
message:

"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) - .Net SqlClient Data Provider"

if I try to force TCP/IP specifying "Network Library=DBMSSOCN;" then it
does not work at all from any machine and I get the following error:
"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: TCP Provider, error: 0 - No connection could be made because
the target machine actively refused it.) - Net SqlClient Data Provider"

SQL Server is on default port 1433 and both TCP/IP and Named Pipes
protocols are enabled.
Any advice on this is much appreciated.

Thanks,
Vikram

Jun 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.